Open silviusimeria opened 3 years ago
I came across the same problem (I was using the representable
gem, which uses this as a dependency) - the problem for me was when I was specifying custom getters for properties like so:
class MyDecorator < Representable::Decorator
property :foo, getter: ->(represented:, **) { represented.bar }
end
My solution was to just change the args to options
:
class MyDecorator < Representable::Decorator
property :foo, getter: ->(options) { options[:represented].bar }
end
I definitely prefer the clarity of keyword arguments, but this way it silenced all of the warnings and was fairly low effort
I get this warning because Ruby 2.7 deprecated the use of hashes in the last argument of a method call.