Module: Ant::Client::Format

Extended by:
DRY::ResourceInjector
Defined in:
lib/ant/client/format/format.rb,
lib/ant/client/format/json_format.rb,
lib/ant/client/format/url_encoded.rb

Overview

Singleton storing all the formats implemented for http clients.

Defined Under Namespace

Classes: JSONFormat, URLEncodedFormat

Class Method Summary collapse

Class Method Details

.build(config) ⇒ Object



12
13
14
# File 'lib/ant/client/format/format.rb', line 12

def build(config)
  resource(:formats, config[:format] || 'json').new
end

.register_format(name, klass) ⇒ Object



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

def register_format(name, klass)
  register(:formats, name, klass)
end