Class: Messenger::Elements::Summary

Inherits:
Object
  • Object
show all
Includes:
Components::Element
Defined in:
lib/messenger/components/elements/receipt/summary.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Components::Element

#build, #build_elements

Constructor Details

#initialize(subtotal: nil, shipping_cost: nil, total_tax: nil, total_cost:) ⇒ Summary

Returns a new instance of Summary.



10
11
12
13
14
15
# File 'lib/messenger/components/elements/receipt/summary.rb', line 10

def initialize(subtotal: nil, shipping_cost: nil, total_tax: nil, total_cost:)
  @subtotal      = subtotal
  @shipping_cost = shipping_cost
  @total_tax     = total_tax
  @total_cost    = total_cost
end

Instance Attribute Details

#shipping_costObject

Returns the value of attribute shipping_cost.



8
9
10
# File 'lib/messenger/components/elements/receipt/summary.rb', line 8

def shipping_cost
  @shipping_cost
end

#subtotalObject

Returns the value of attribute subtotal.



8
9
10
# File 'lib/messenger/components/elements/receipt/summary.rb', line 8

def subtotal
  @subtotal
end

#total_costObject

Returns the value of attribute total_cost.



8
9
10
# File 'lib/messenger/components/elements/receipt/summary.rb', line 8

def total_cost
  @total_cost
end

#total_taxObject

Returns the value of attribute total_tax.



8
9
10
# File 'lib/messenger/components/elements/receipt/summary.rb', line 8

def total_tax
  @total_tax
end