Class: Moo::Model::ImageBasket

Inherits:
Object
  • Object
show all
Defined in:
lib/moo/model/image_basket.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize {|_self| ... } ⇒ ImageBasket

Returns a new instance of ImageBasket.

Yields:

  • (_self)

Yield Parameters:



6
7
8
# File 'lib/moo/model/image_basket.rb', line 6

def initialize
  yield self if block_given?
end

Instance Attribute Details

#itemsObject

Returns the value of attribute items.



4
5
6
# File 'lib/moo/model/image_basket.rb', line 4

def items
  @items
end

Instance Method Details

#to_hashObject



10
11
12
13
14
# File 'lib/moo/model/image_basket.rb', line 10

def to_hash
  hash = {
    :items => items.map {|i| i.to_hash }
  }
end

#to_jsonObject



16
17
18
# File 'lib/moo/model/image_basket.rb', line 16

def to_json
  to_hash.to_json
end