Module: Typekit::Configuration

Defined in:
lib/typekit/configuration.rb,
lib/typekit/configuration/base.rb,
lib/typekit/configuration/default.rb

Defined Under Namespace

Classes: Base, Default

Constant Summary collapse

Error =
Class.new(Typekit::Error)

Class Method Summary collapse

Class Method Details

.build(name, **options) ⇒ Object



8
9
10
11
12
13
14
# File 'lib/typekit/configuration.rb', line 8

def self.build(name, **options)
  self.const_get(name.to_s.capitalize).new(**options)
rescue NameError
  raise Error, 'Unknown configuration'
rescue ArgumentError => e
  raise Error, 'Not enough arguments'
end