Ruby doesn't know if it's a hash or a block - that's why you need parentheses. ie:
foo.bar { .... }
the intent of the braces is ambiguous (and is most likely a block), but
foo.bar( { .... } )
clearly is taking a hash as an argument.
Ruby doesn't know if it's a hash or a block - that's why you need parentheses. ie:
foo.bar { .... }
the intent of the braces is ambiguous (and is most likely a block), but
foo.bar( { .... } )
clearly is taking a hash as an argument.