Class: Kooaba::Item

Inherits:
Object
  • Object
show all
Defined in:
lib/kooaba/item.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ Item

Returns a new instance of Item.

Raises:

  • (TypeError)


16
17
18
19
20
21
22
23
24
25
26
27
28
29
# File 'lib/kooaba/item.rb', line 16

def initialize(options = {})
  raise TypeError, "enabled should be true or false" unless [nil, true, false].include? options[:enabled]
  if !options[:image_files].instance_of?(Array) && options[:image_files] != nil
    raise TypeError, "image_files must be a list of paths (Array of Strings)"
  end

  @title        = options[:title]
  @metadata     = options[:metadata]
  @enabled      = options[:enabled] == nil ? true : options[:enabled]
  @reference_id = options[:reference_id]
  @image_files  = options[:image_files] || []
  @locale       = options[:locale]
  @kind         = options[:kind]
end

Instance Attribute Details

#enabledObject

Returns the value of attribute enabled.



10
11
12
# File 'lib/kooaba/item.rb', line 10

def enabled
  @enabled
end

#image_filesObject

Returns the value of attribute image_files.



12
13
14
# File 'lib/kooaba/item.rb', line 12

def image_files
  @image_files
end

#images_sha1Object

Returns the value of attribute images_sha1.



6
7
8
# File 'lib/kooaba/item.rb', line 6

def images_sha1
  @images_sha1
end

#kindObject

Returns the value of attribute kind.



14
15
16
# File 'lib/kooaba/item.rb', line 14

def kind
  @kind
end

#localeObject

Returns the value of attribute locale.



13
14
15
# File 'lib/kooaba/item.rb', line 13

def locale
  @locale
end

#metadataObject

Returns the value of attribute metadata.



9
10
11
# File 'lib/kooaba/item.rb', line 9

def 
  @metadata
end

#reference_idObject

Returns the value of attribute reference_id.



11
12
13
# File 'lib/kooaba/item.rb', line 11

def reference_id
  @reference_id
end

#titleObject

Returns the value of attribute title.



8
9
10
# File 'lib/kooaba/item.rb', line 8

def title
  @title
end

#uuidObject

Returns the value of attribute uuid.



5
6
7
# File 'lib/kooaba/item.rb', line 5

def uuid
  @uuid
end