lib/grape/router/attribute_translator.rb in grape-1.4.0 vs lib/grape/router/attribute_translator.rb in grape-1.5.0

- old
+ new

@@ -21,11 +21,11 @@ namespace ].freeze ROUTER_ATTRIBUTES = %i[pattern index].freeze - def initialize(attributes = {}) + def initialize(**attributes) @attributes = attributes end (ROUTER_ATTRIBUTES + ROUTE_ATTRIBUTES).each do |attr| define_method attr do @@ -35,10 +35,10 @@ def to_h attributes end - def method_missing(method_name, *args) # rubocop:disable Style/MethodMissing + def method_missing(method_name, *args) if setter?(method_name[-1]) attributes[method_name[0..-1]] = *args else attributes[method_name] end