Module: LazyAnt::DSL::Endpoint::ClassMethods
- Defined in:
- lib/lazy_ant/dsl/endpoint.rb
Instance Method Summary collapse
Instance Method Details
#api(name, options = {}, &block) ⇒ Object
12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/lazy_ant/dsl/endpoint.rb', line 12 def api(name, = {}, &block) method, path = endpoint() klazz = Class.new(LazyAnt::Endpoint) do send(method, path) if method && path instance_eval(&block) if block end converter = entity_converter() define_method name do |*args| response = klazz.new(*args).execute(connection) converter.call(response.body) end end |