Module: Typekit::Converter

Defined in:
lib/typekit/converter.rb,
lib/typekit/converter/errors.rb,
lib/typekit/converter/boolean.rb,
lib/typekit/converter/element.rb,
lib/typekit/converter/unknown.rb,
lib/typekit/converter/datetime.rb,
lib/typekit/converter/collection.rb

Defined Under Namespace

Classes: Boolean, Collection, DateTime, Element, Errors, Unknown

Constant Summary collapse

MAPPING =
{
  :element => Element,
  :collection => Collection,

  'ok' => Boolean,
  'errors' => Errors,
  'published' => DateTime,

  nil => Errors
}

Class Method Summary collapse

Class Method Details

.build(name, *arguments) ⇒ Object



22
23
24
# File 'lib/typekit/converter.rb', line 22

def self.build(name, *arguments)
  MAPPING[Record.identify(name) || name].new(name, *arguments)
end