Class: InvoiceVatItem
- Inherits:
-
Object
- Object
- InvoiceVatItem
- Defined in:
- lib/fastbill/invoice_vat_item.rb
Instance Attribute Summary collapse
-
#vat_percent ⇒ Object
Returns the value of attribute vat_percent.
-
#vat_value ⇒ Object
Returns the value of attribute vat_value.
Instance Method Summary collapse
-
#initialize(body) ⇒ InvoiceVatItem
constructor
A new instance of InvoiceVatItem.
- #to_xml ⇒ Object
Constructor Details
#initialize(body) ⇒ InvoiceVatItem
Returns a new instance of InvoiceVatItem.
4 5 6 7 8 |
# File 'lib/fastbill/invoice_vat_item.rb', line 4 def initialize(body) @vat_percent = body["VAT_PERCENT"] @vat_value = body["VAT_VALUE"] self end |
Instance Attribute Details
#vat_percent ⇒ Object
Returns the value of attribute vat_percent.
2 3 4 |
# File 'lib/fastbill/invoice_vat_item.rb', line 2 def vat_percent @vat_percent end |
#vat_value ⇒ Object
Returns the value of attribute vat_value.
2 3 4 |
# File 'lib/fastbill/invoice_vat_item.rb', line 2 def vat_value @vat_value end |
Instance Method Details
#to_xml ⇒ Object
9 10 11 12 13 14 15 16 17 18 |
# File 'lib/fastbill/invoice_vat_item.rb', line 9 def to_xml xml = "<VAT_ITEM>" unless @vat_percent.nil? xml = "<VAT_PERCENT>#{@vat_percent}</VAT_PERCENT>" end unless @vat_value.nil? xml = "<VAT_VALUE>#{@vat_value}</VAT_VALUE>" end xml + "</VAT_ITEM>" end |