Asterisk
The asterisk symbol (*) is used in several syntactically distinct ways in Ruby. You are probably looking for one of the following:
- Array Argument:
def method(*x) - Rest in Multiple Assignment:
a, b, *rest = (1..10).to_a - Splat:
some_method(*[1, 2, 3]) - Arbitrary Keyword Arguments:
def some_method(**kwargs) - Double Splat:
some_method(**{a: 1, b: 2}) - Raise to the Power Operator:
4**5 => 1024 - Multiplication Operator:
5 * 4 => 20