Class: DPLibrary::CollectionItem

Inherits:
Object
  • Object
show all
Defined in:
lib/DPLibrary/collection_item.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(collection_hash) ⇒ CollectionItem

Returns a new instance of CollectionItem.



7
8
9
# File 'lib/DPLibrary/collection_item.rb', line 7

def initialize(collection_hash)
  set_values(collection_hash)
end

Instance Attribute Details

#idObject

Returns the value of attribute id.



3
4
5
# File 'lib/DPLibrary/collection_item.rb', line 3

def id
  @id
end

#nameObject

Returns the value of attribute name.



3
4
5
# File 'lib/DPLibrary/collection_item.rb', line 3

def name
  @name
end

#titleObject

Returns the value of attribute title.



3
4
5
# File 'lib/DPLibrary/collection_item.rb', line 3

def title
  @title
end

Instance Method Details

#set_values(collection_hash) ⇒ Object



11
12
13
14
15
# File 'lib/DPLibrary/collection_item.rb', line 11

def set_values(collection_hash)
  self.id = collection_hash['id']
  self.title = collection_hash['title']
  self.name = collection_hash['name']
end