adomokos / light-service

Series of Actions with an emphasis on simplicity.
MIT License
837 stars 67 forks source link

Only pass default argument to Hash#fetch in context if no block given #123

Closed robwilliams closed 6 years ago

robwilliams commented 6 years ago

Hash#fetch outputs a warning if the arg count is 2 and a block is given.

It's not possible to just pass a block without this change as the key and default_or_block arguments are always passed to the parent method.

Checking if there is a block and only passing the default if there is no block stops the warning message from showing.

adomokos commented 6 years ago

Thank you!! 👍