Class: Jirafe::Resource::Carts::Item

Inherits:
Object
  • Object
show all
Includes:
DataHelper, Model
Defined in:
lib/jirafe/resource/carts/item.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from DataHelper

#format_amount, #format_discount_amount

Methods included from Model

#attributes, #attributes_for_change, #create, included, #initialize, #reinitialize, #update

Instance Attribute Details

#categoryObject

Returns the value of attribute category.



7
8
9
# File 'lib/jirafe/resource/carts/item.rb', line 7

def category
  @category
end

#nameObject

Returns the value of attribute name.



7
8
9
# File 'lib/jirafe/resource/carts/item.rb', line 7

def name
  @name
end

#priceObject

Returns the value of attribute price.



7
8
9
# File 'lib/jirafe/resource/carts/item.rb', line 7

def price
  @price
end

#quantityObject

Returns the value of attribute quantity.



7
8
9
# File 'lib/jirafe/resource/carts/item.rb', line 7

def quantity
  @quantity
end

#skuObject

Returns the value of attribute sku.



7
8
9
# File 'lib/jirafe/resource/carts/item.rb', line 7

def sku
  @sku
end

Instance Method Details

#dataObject



9
10
11
# File 'lib/jirafe/resource/carts/item.rb', line 9

def data
  [sku, name, category, format_amount(price), quantity]
end