lib/strict/interface.rb in strict-1.1.0 vs lib/strict/interface.rb in strict-1.2.0

- old
+ new

@@ -5,16 +5,17 @@ def self.extended(mod) mod.extend(Strict::Method) mod.include(Interfaces::Instance) end - def expose(method_name, &) - sig = sig(&) + def expose(method_name, &block) + sig = sig(&block) parameter_list = sig.parameters.map { |parameter| "#{parameter.name}:" }.join(", ") + argument_list = sig.parameters.map { |parameter| "#{parameter.name}: #{parameter.name}" }.join(", ") module_eval(<<~RUBY, __FILE__, __LINE__ + 1) def #{method_name}(#{parameter_list}, &block) # def method_name(one:, two:, three:, &block) - implementation.#{method_name}(#{parameter_list}, &block) # implementation.method_name(one:, two:, three:, &block) + implementation.#{method_name}(#{argument_list}, &block) # implementation.method_name(one: one, two: two, three: three, &block) end # end RUBY end end end