Module: Ant::Client::Format

Defined in:
lib/ant/client/format/format.rb,
lib/ant/client/format/json_format.rb,
lib/ant/client/format/url_encoded.rb

Defined Under Namespace

Classes: JSONFormat, URLEncodedFormat

Class Method Summary collapse

Class Method Details

.build(config) ⇒ Object



8
9
10
11
# File 'lib/ant/client/format/format.rb', line 8

def build(config)
  @formats ||= default_formats
  @formats[config[:format]].new
end

.default_formatsObject



13
14
15
16
17
18
# File 'lib/ant/client/format/format.rb', line 13

def default_formats
  {
    json: JSONFormat,
    url_encoded: URLEncodedFormat
  }
end