Class: Eol::Collections

Inherits:
Object
  • Object
show all
Includes:
Enumerable
Defined in:
lib/eol/collections.rb

Overview

Contains metadata about the collection and the items it contains

Instance Attribute Summary collapse

Instance Method Summary collapse

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_itemsArray



22
23
24
# File 'lib/eol/collections.rb', line 22

def collection_items
  @collection_items
end

#createdString



14
15
16
# File 'lib/eol/collections.rb', line 14

def created
  @created
end

#descriptionString



10
11
12
# File 'lib/eol/collections.rb', line 10

def description
  @description
end

#item_typesArray



20
21
22
# File 'lib/eol/collections.rb', line 20

def item_types
  @item_types
end

#logo_urlString



12
13
14
# File 'lib/eol/collections.rb', line 12

def logo_url
  @logo_url
end

#modifiedString



16
17
18
# File 'lib/eol/collections.rb', line 16

def modified
  @modified
end

#nameString



8
9
10
# File 'lib/eol/collections.rb', line 8

def name
  @name
end

#total_itemsInteger



18
19
20
# File 'lib/eol/collections.rb', line 18

def total_items
  @total_items
end

Instance Method Details

#each {|@name| ... } ⇒ Object

Yields:



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