lib/surrounded/context/negotiator.rb in surrounded-1.0.0 vs lib/surrounded/context/negotiator.rb in surrounded-1.1.0

- old
+ new

@@ -13,12 +13,13 @@ end # For each method in the module, directly forward to the wrapped object to # circumvent method_missing mod.instance_methods(false).each do |meth| num = __LINE__; klass.class_eval %{ - def #{meth}(*args, &block) - __behaviors__.instance_method(:#{meth}).bind(@object).call(*args, &block) + def #{meth}(...) + @#{meth}_method ||= __behaviors__.instance_method(:#{meth}).bind(@object) + @#{meth}_method.call(...) end }, __FILE__, num end klass end @@ -55,15 +56,15 @@ def initialize(object) @object = object end - def method_missing(meth, *args, &block) - @object.send(meth, *args, &block) + def method_missing(meth, ...) + @object.send(meth, ...) end def respond_to_missing?(meth, include_private=false) @object.respond_to?(meth, include_private) end end end -end \ No newline at end of file +end