lib/surrogate/endower.rb in surrogate-0.6.5 vs lib/surrogate/endower.rb in surrogate-0.7.0
- old
+ new
@@ -76,14 +76,14 @@
klass.instance_variable_set :@hatchery, Surrogate::Hatchery.new(klass, options)
end
def enable_defining_methods(klass)
def klass.define(method_name, options={}, &block)
+ block ||= lambda {}
@hatchery.define method_name.to_sym, options, &block
end
def klass.define_reader(*method_names, &block)
- block ||= lambda {}
method_names.each { |method_name| define method_name, &block }
self
end
def klass.define_writer(*method_names)