Module: LazyAnt::DSL::Connection::ClassMethods

Defined in:
lib/lazy_ant/dsl/connection.rb

Instance Method Summary collapse

Instance Method Details

#base_url(url = nil, &block) ⇒ Object



61
62
63
64
65
66
67
68
69
70
71
# File 'lib/lazy_ant/dsl/connection.rb', line 61

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



78
79
80
# File 'lib/lazy_ant/dsl/connection.rb', line 78

def connection(&block)
  @default_callback = block
end

#converter(name = nil, &block) ⇒ Object



73
74
75
76
# File 'lib/lazy_ant/dsl/connection.rb', line 73

def converter(name = nil, &block)
  return @converter_block = block if block_given?
  @converter_name = name if name
end

#request(type) ⇒ Object



82
83
84
# File 'lib/lazy_ant/dsl/connection.rb', line 82

def request(type)
  @request_type = type
end

#response(type) ⇒ Object



86
87
88
# File 'lib/lazy_ant/dsl/connection.rb', line 86

def response(type)
  @response_type = type
end