Class: TheTracker::Trackers::EcommerceTransaction

Inherits:
Struct
  • Object
show all
Defined in:
lib/the_tracker/trackers/g_universal.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#idObject

Returns the value of attribute id

Returns:

  • (Object)

    the current value of id



123
124
125
# File 'lib/the_tracker/trackers/g_universal.rb', line 123

def id
  @id
end

#shippingObject

Returns the value of attribute shipping

Returns:

  • (Object)

    the current value of shipping



123
124
125
# File 'lib/the_tracker/trackers/g_universal.rb', line 123

def shipping
  @shipping
end

#storeObject

Returns the value of attribute store

Returns:

  • (Object)

    the current value of store



123
124
125
# File 'lib/the_tracker/trackers/g_universal.rb', line 123

def store
  @store
end

#taxObject

Returns the value of attribute tax

Returns:

  • (Object)

    the current value of tax



123
124
125
# File 'lib/the_tracker/trackers/g_universal.rb', line 123

def tax
  @tax
end

#totalObject

Returns the value of attribute total

Returns:

  • (Object)

    the current value of total



123
124
125
# File 'lib/the_tracker/trackers/g_universal.rb', line 123

def total
  @total
end

Instance Method Details

#add_item(sku, product, category, price, quantity) ⇒ Object



124
125
126
# File 'lib/the_tracker/trackers/g_universal.rb', line 124

def add_item(sku, product, category, price, quantity)
  items << EcommerceItem.new(sku, product, category, price, quantity)
end

#itemsObject



128
129
130
# File 'lib/the_tracker/trackers/g_universal.rb', line 128

def items
  @items ||= []
end