Class: Kooaba::Item
- Inherits:
-
Object
- Object
- Kooaba::Item
- Defined in:
- lib/kooaba/item.rb
Instance Attribute Summary collapse
-
#enabled ⇒ Object
Returns the value of attribute enabled.
-
#image_files ⇒ Object
Returns the value of attribute image_files.
-
#images_sha1 ⇒ Object
Returns the value of attribute images_sha1.
-
#kind ⇒ Object
Returns the value of attribute kind.
-
#locale ⇒ Object
Returns the value of attribute locale.
-
#metadata ⇒ Object
Returns the value of attribute metadata.
-
#reference_id ⇒ Object
Returns the value of attribute reference_id.
-
#title ⇒ Object
Returns the value of attribute title.
-
#uuid ⇒ Object
Returns the value of attribute uuid.
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ Item
constructor
A new instance of Item.
Constructor Details
#initialize(options = {}) ⇒ Item
Returns a new instance of Item.
16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
# File 'lib/kooaba/item.rb', line 16 def initialize( = {}) raise TypeError, "enabled should be true or false" unless [nil, true, false].include? [:enabled] if ![:image_files].instance_of?(Array) && [:image_files] != nil raise TypeError, "image_files must be a list of paths (Array of Strings)" end @title = [:title] @metadata = [:metadata] @enabled = [:enabled] == nil ? true : [:enabled] @reference_id = [:reference_id] @image_files = [:image_files] || [] @locale = [:locale] @kind = [:kind] end |
Instance Attribute Details
#enabled ⇒ Object
Returns the value of attribute enabled.
10 11 12 |
# File 'lib/kooaba/item.rb', line 10 def enabled @enabled end |
#image_files ⇒ Object
Returns the value of attribute image_files.
12 13 14 |
# File 'lib/kooaba/item.rb', line 12 def image_files @image_files end |
#images_sha1 ⇒ Object
Returns the value of attribute images_sha1.
6 7 8 |
# File 'lib/kooaba/item.rb', line 6 def images_sha1 @images_sha1 end |
#kind ⇒ Object
Returns the value of attribute kind.
14 15 16 |
# File 'lib/kooaba/item.rb', line 14 def kind @kind end |
#locale ⇒ Object
Returns the value of attribute locale.
13 14 15 |
# File 'lib/kooaba/item.rb', line 13 def locale @locale end |
#metadata ⇒ Object
Returns the value of attribute metadata.
9 10 11 |
# File 'lib/kooaba/item.rb', line 9 def @metadata end |
#reference_id ⇒ Object
Returns the value of attribute reference_id.
11 12 13 |
# File 'lib/kooaba/item.rb', line 11 def reference_id @reference_id end |
#title ⇒ Object
Returns the value of attribute title.
8 9 10 |
# File 'lib/kooaba/item.rb', line 8 def title @title end |
#uuid ⇒ Object
Returns the value of attribute uuid.
5 6 7 |
# File 'lib/kooaba/item.rb', line 5 def uuid @uuid end |