lib/roda/endpoints/endpoint/class_interface.rb in roda-endpoints-0.3.0 vs lib/roda/endpoints/endpoint/class_interface.rb in roda-endpoints-0.3.1
- old
+ new
@@ -36,17 +36,10 @@
def inherited(child)
child.attributes = attributes.dup
child.defaults = defaults.dup
child.statuses = statuses.dup
child.verbs = verbs.dup
- # child.verbs.each do |verb|
- # key = "operations.#{child.type}.#{verb}"
- # implementation = "operations.#{type}.#{verb}"
- # container.register key do
- # Endpoints.container.resolve implementation
- # end
- # end
child.transactions = transactions.dup
child.route(&@route_block)
super
end
@@ -74,10 +67,11 @@
Left($ERROR_INFO)
end
end
end
define_method(verb, &block)
- container.register "operations.#{type}.#{verb}", block
+ key = "operations.#{type}.#{verb}"
+ container.register key, block
end
# @param [String, Symbol] key
# @param [Proc] block
#