Class: Jirafe::Callback::Events::Item

Inherits:
Object
  • Object
show all
Includes:
DataHelper, Model
Defined in:
lib/jirafe/callback/events/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/callback/events/item.rb', line 7

def category
  @category
end

#nameObject

Returns the value of attribute name.



7
8
9
# File 'lib/jirafe/callback/events/item.rb', line 7

def name
  @name
end

#priceObject

Returns the value of attribute price.



7
8
9
# File 'lib/jirafe/callback/events/item.rb', line 7

def price
  @price
end

#quantityObject

Returns the value of attribute quantity.



7
8
9
# File 'lib/jirafe/callback/events/item.rb', line 7

def quantity
  @quantity
end

#skuObject

Returns the value of attribute sku.



7
8
9
# File 'lib/jirafe/callback/events/item.rb', line 7

def sku
  @sku
end

Instance Method Details

#dataObject



9
10
11
12
13
14
15
16
17
# File 'lib/jirafe/callback/events/item.rb', line 9

def data
  {
    "sku" => sku,
    "name" => name,
    "price" => format_amount(price),
    "quantity" => quantity,
    "category" => category
  }
end