Class: DPLibrary::CollectionItem
- Inherits:
-
Object
- Object
- DPLibrary::CollectionItem
- Defined in:
- lib/DPLibrary/collection_item.rb
Instance Attribute Summary collapse
-
#id ⇒ Object
Returns the value of attribute id.
-
#name ⇒ Object
Returns the value of attribute name.
-
#title ⇒ Object
Returns the value of attribute title.
Instance Method Summary collapse
-
#initialize(collection_hash) ⇒ CollectionItem
constructor
A new instance of CollectionItem.
- #set_values(collection_hash) ⇒ Object
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
#id ⇒ Object
Returns the value of attribute id.
3 4 5 |
# File 'lib/DPLibrary/collection_item.rb', line 3 def id @id end |
#name ⇒ Object
Returns the value of attribute name.
3 4 5 |
# File 'lib/DPLibrary/collection_item.rb', line 3 def name @name end |
#title ⇒ Object
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 |