module Typekit::Element

Public Class Methods

build(name, *arguments) click to toggle source
# File lib/typekit/element.rb, line 23
def self.build(name, *arguments)
  classify(name).new(*arguments)
end
classify(name) click to toggle source
# File lib/typekit/element.rb, line 19
def self.classify(name)
  dictionary[Helper.tokenize(name)]
end
dictionary() click to toggle source
# File lib/typekit/element.rb, line 9
def self.dictionary
  @dictionary ||= Hash[
    ObjectSpace.each_object(Class).select do |klass|
      klass < Base && klass.name
    end.map do |klass|
      [Helper.tokenize(klass), klass]
    end
  ]
end