lib/surrogate/hatchling.rb in surrogate-0.4.2 vs lib/surrogate/hatchling.rb in surrogate-0.4.3
- old
+ new
@@ -15,11 +15,11 @@
hatchery.api_methods
end
def invoke_method(method_name, args, &block)
invoked_methods[method_name] << args
- return get_default method_name, args unless has_ivar? method_name
+ return get_default method_name, args, &block unless has_ivar? method_name
Value.factory(get_ivar method_name).value(self, method_name)
end
def prepare_method(method_name, args, &block)
set_ivar method_name, Value.factory(*args, &block)
@@ -62,11 +62,11 @@
must_know method_name
hash[method_name] = []
end
end
- def get_default(method_name, args)
- api_methods[method_name].default instance, args do
+ def get_default(method_name, args, &block)
+ api_methods[method_name].default instance, args, block do
raise UnpreparedMethodError, "#{method_name} has been invoked without being told how to behave"
end
end
def must_know(method_name)