Class: Xrechnung::Quantity

Inherits:
Struct
  • Object
show all
Defined in:
lib/xrechnung/quantity.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#amountObject

Returns the value of attribute amount

Returns:

  • (Object)

    the current value of amount



2
3
4
# File 'lib/xrechnung/quantity.rb', line 2

def amount
  @amount
end

#unit_codeObject

Returns the value of attribute unit_code

Returns:

  • (Object)

    the current value of unit_code



2
3
4
# File 'lib/xrechnung/quantity.rb', line 2

def unit_code
  @unit_code
end

Instance Method Details

#amount_to_sObject



3
4
5
# File 'lib/xrechnung/quantity.rb', line 3

def amount_to_s
  format("%0.2f", amount)
end

#xml_argsObject



7
8
9
# File 'lib/xrechnung/quantity.rb', line 7

def xml_args
  [amount_to_s, { unitCode: unit_code }]
end