Module: LazyAnt::DSL::Connection::ClassMethods
- Defined in:
- lib/lazy_ant/dsl/connection.rb
Instance Method Summary collapse
- #base_url(url = nil, &block) ⇒ Object
- #connection(&block) ⇒ Object
- #converter(name = nil, &block) ⇒ Object
- #request(type) ⇒ Object
- #response(type) ⇒ Object
Instance Method Details
#base_url(url = nil, &block) ⇒ Object
69 70 71 72 73 74 75 76 77 78 79 |
# File 'lib/lazy_ant/dsl/connection.rb', line 69 def base_url(url = nil, &block) if block_given? define_method :base_url do @base_url ||= instance_eval(&block) end else define_method :base_url do url end end end |
#connection(&block) ⇒ Object
86 87 88 |
# File 'lib/lazy_ant/dsl/connection.rb', line 86 def connection(&block) @default_callback = block end |
#converter(name = nil, &block) ⇒ Object
81 82 83 84 |
# File 'lib/lazy_ant/dsl/connection.rb', line 81 def converter(name = nil, &block) return @converter_block = block if block_given? @converter_name = name if name end |
#request(type) ⇒ Object
90 91 92 |
# File 'lib/lazy_ant/dsl/connection.rb', line 90 def request(type) @request_type = type end |
#response(type) ⇒ Object
94 95 96 |
# File 'lib/lazy_ant/dsl/connection.rb', line 94 def response(type) @response_type = type end |