Class: Sendregning::Line
- Inherits:
-
Object
- Object
- Sendregning::Line
- Defined in:
- lib/sendregning/line.rb
Instance Attribute Summary collapse
-
#desc ⇒ Object
Description.
-
#discount ⇒ Object
Discount in percentage as decimal.
-
#itemNo ⇒ Object
Returns the value of attribute itemNo.
-
#lineTaxAmount ⇒ Object
Returns the value of attribute lineTaxAmount.
-
#lineTotal ⇒ Object
Returns the value of attribute lineTotal.
-
#prodCode ⇒ Object
Product code.
-
#qty ⇒ Object
Quantity, as decimal.
-
#tax ⇒ Object
Tax rate.
-
#unitPrice ⇒ Object
Price per unit in decimal.
Instance Method Summary collapse
-
#initialize(new_attributes = {}) ⇒ Line
constructor
A new instance of Line.
-
#to_xml(options = {}) ⇒ Object
Renders line to XML.
Constructor Details
#initialize(new_attributes = {}) ⇒ Line
Returns a new instance of Line.
23 24 25 |
# File 'lib/sendregning/line.rb', line 23 def initialize(new_attributes={}) self.attributes = new_attributes end |
Instance Attribute Details
#desc ⇒ Object
Description. String, max length: 75
10 11 12 |
# File 'lib/sendregning/line.rb', line 10 def desc @desc end |
#discount ⇒ Object
Discount in percentage as decimal. Optional, defaults to 0
16 17 18 |
# File 'lib/sendregning/line.rb', line 16 def discount @discount end |
#itemNo ⇒ Object
Returns the value of attribute itemNo.
21 22 23 |
# File 'lib/sendregning/line.rb', line 21 def itemNo @itemNo end |
#lineTaxAmount ⇒ Object
Returns the value of attribute lineTaxAmount.
21 22 23 |
# File 'lib/sendregning/line.rb', line 21 def lineTaxAmount @lineTaxAmount end |
#lineTotal ⇒ Object
Returns the value of attribute lineTotal.
21 22 23 |
# File 'lib/sendregning/line.rb', line 21 def lineTotal @lineTotal end |
#prodCode ⇒ Object
Product code. String, max length: 9
7 8 9 |
# File 'lib/sendregning/line.rb', line 7 def prodCode @prodCode end |
#qty ⇒ Object
Quantity, as decimal. Example: ‘7,5’
4 5 6 |
# File 'lib/sendregning/line.rb', line 4 def qty @qty end |
#tax ⇒ Object
Tax rate. Valid rates are: ‘0’, ‘8’, ‘13’ and ‘25’. Default: ‘25’
19 20 21 |
# File 'lib/sendregning/line.rb', line 19 def tax @tax end |
#unitPrice ⇒ Object
Price per unit in decimal. Example: ‘250,00’
13 14 15 |
# File 'lib/sendregning/line.rb', line 13 def unitPrice @unitPrice end |
Instance Method Details
#to_xml(options = {}) ⇒ Object
Renders line to XML
28 29 30 |
# File 'lib/sendregning/line.rb', line 28 def to_xml(={}) LineSerializer.build(self, ) end |