Class: Typekit::Collection

Inherits:
Object
  • Object
show all
Extended by:
Forwardable
Defined in:
lib/typekit/collection.rb

Instance Method Summary collapse

Constructor Details

#initialize(name, collection_attributes = nil) ⇒ Collection

Returns a new instance of Collection.



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

def initialize(name, collection_attributes = nil)
  @klass = Record.classify(name)
  @records = collection_attributes.map do |attributes|
    @klass.new(attributes)
  end
end