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



116
117
118
# File 'lib/the_tracker/trackers/g_universal.rb', line 116

def id
  @id
end

#shippingObject

Returns the value of attribute shipping

Returns:

  • (Object)

    the current value of shipping



116
117
118
# File 'lib/the_tracker/trackers/g_universal.rb', line 116

def shipping
  @shipping
end

#storeObject

Returns the value of attribute store

Returns:

  • (Object)

    the current value of store



116
117
118
# File 'lib/the_tracker/trackers/g_universal.rb', line 116

def store
  @store
end

#taxObject

Returns the value of attribute tax

Returns:

  • (Object)

    the current value of tax



116
117
118
# File 'lib/the_tracker/trackers/g_universal.rb', line 116

def tax
  @tax
end

#totalObject

Returns the value of attribute total

Returns:

  • (Object)

    the current value of total



116
117
118
# File 'lib/the_tracker/trackers/g_universal.rb', line 116

def total
  @total
end

Instance Method Details

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



117
118
119
# File 'lib/the_tracker/trackers/g_universal.rb', line 117

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

#itemsObject



121
122
123
# File 'lib/the_tracker/trackers/g_universal.rb', line 121

def items
  @items ||= []
end