Class: MusicTodayApiWrapper::Resources::Purchase::Invoice
- Inherits:
-
Object
- Object
- MusicTodayApiWrapper::Resources::Purchase::Invoice
- Defined in:
- lib/resources/purchase/invoice.rb
Instance Attribute Summary collapse
-
#id ⇒ Object
Returns the value of attribute id.
-
#shipping ⇒ Object
Returns the value of attribute shipping.
-
#sub_total ⇒ Object
Returns the value of attribute sub_total.
-
#taxes ⇒ Object
Returns the value of attribute taxes.
-
#total ⇒ Object
Returns the value of attribute total.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(id, sub_total, shipping, taxes) ⇒ Invoice
constructor
A new instance of Invoice.
Constructor Details
#initialize(id, sub_total, shipping, taxes) ⇒ Invoice
Returns a new instance of Invoice.
7 8 9 10 11 12 13 |
# File 'lib/resources/purchase/invoice.rb', line 7 def initialize(id, sub_total, shipping, taxes) @id = id @sub_total = sub_total.to_f @shipping = shipping.to_f @taxes = taxes.to_f @total = (@sub_total + @shipping + @taxes).round(2) end |
Instance Attribute Details
#id ⇒ Object
Returns the value of attribute id.
5 6 7 |
# File 'lib/resources/purchase/invoice.rb', line 5 def id @id end |
#shipping ⇒ Object
Returns the value of attribute shipping.
5 6 7 |
# File 'lib/resources/purchase/invoice.rb', line 5 def shipping @shipping end |
#sub_total ⇒ Object
Returns the value of attribute sub_total.
5 6 7 |
# File 'lib/resources/purchase/invoice.rb', line 5 def sub_total @sub_total end |
#taxes ⇒ Object
Returns the value of attribute taxes.
5 6 7 |
# File 'lib/resources/purchase/invoice.rb', line 5 def taxes @taxes end |
#total ⇒ Object
Returns the value of attribute total.
5 6 7 |
# File 'lib/resources/purchase/invoice.rb', line 5 def total @total end |