lib/surrogate/hatchery.rb in surrogate-0.5.5 vs lib/surrogate/hatchery.rb in surrogate-0.6.0

- old
+ new

@@ -13,19 +13,24 @@ def define(method_name, options={}, &block) add_api_method_for method_name add_verb_helpers_for method_name add_noun_helpers_for method_name - api_methods[method_name] = Options.new options, block + api_methods[method_name] = MethodDefinition.new method_name, options, block klass end def api_methods @api_methods ||= {} end def api_method_names api_methods.keys - [:initialize] + end + + def api_method_for(name) + options = api_methods[name] + options && options.default_proc end private def klass_can_define_api_methods