Class: Eol::Collections
- Inherits:
-
Object
- Object
- Eol::Collections
- Includes:
- Enumerable
- Defined in:
- lib/eol/collections.rb
Overview
Contains metadata about the collection and the items it contains
Instance Attribute Summary collapse
-
#collection_items ⇒ Array
An Array of Hashes.
-
#created ⇒ String
Created timestamp.
-
#description ⇒ String
Collections description.
-
#item_types ⇒ Array
An Array of Hashes.
-
#logo_url ⇒ String
A hyperlink to the logo.
-
#modified ⇒ String
Modified timestamp.
-
#name ⇒ String
Collections name.
-
#total_items ⇒ Integer
Total collections items.
Instance Method Summary collapse
- #each {|@name| ... } ⇒ Object
-
#initialize(response) ⇒ Collections
constructor
A new instance of Collections.
Constructor Details
#initialize(response) ⇒ Collections
24 25 26 27 28 29 30 31 32 33 |
# File 'lib/eol/collections.rb', line 24 def initialize(response) self.name = response['name'] self.description = response['description'] self.logo_url = response['logo_url'] self.created = response['created'] self.modified = response['modified'] self.total_items = response['total_items'] self.item_types = response['item_types'] self.collection_items = response['collection_items'] end |
Instance Attribute Details
#collection_items ⇒ Array
22 23 24 |
# File 'lib/eol/collections.rb', line 22 def collection_items @collection_items end |
#created ⇒ String
14 15 16 |
# File 'lib/eol/collections.rb', line 14 def created @created end |
#description ⇒ String
10 11 12 |
# File 'lib/eol/collections.rb', line 10 def description @description end |
#item_types ⇒ Array
20 21 22 |
# File 'lib/eol/collections.rb', line 20 def item_types @item_types end |
#logo_url ⇒ String
12 13 14 |
# File 'lib/eol/collections.rb', line 12 def logo_url @logo_url end |
#modified ⇒ String
16 17 18 |
# File 'lib/eol/collections.rb', line 16 def modified @modified end |
#name ⇒ String
8 9 10 |
# File 'lib/eol/collections.rb', line 8 def name @name end |
#total_items ⇒ Integer
18 19 20 |
# File 'lib/eol/collections.rb', line 18 def total_items @total_items end |
Instance Method Details
#each {|@name| ... } ⇒ Object
35 36 37 38 39 40 41 42 43 44 |
# File 'lib/eol/collections.rb', line 35 def each yield @name yield @description yield @logo_url yield @created yield @modified yield @total_items yield @item_types yield @collection_items end |