Class: Xrechnung::Price

Inherits:
Object
  • Object
show all
Includes:
MemberContainer
Defined in:
lib/xrechnung/price.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from MemberContainer

#[], #[]=, included

Constructor Details

#initialize(**kwargs) ⇒ Price

Returns a new instance of Price.



17
18
19
20
# File 'lib/xrechnung/price.rb', line 17

def initialize(**kwargs)
  kwargs[:price_amount] = Currency::EUR(kwargs[:price_amount]) unless kwargs[:price_amount].is_a?(Currency)
  super(**kwargs)
end

Instance Attribute Details

#allowance_chargeXrechnung::AllowanceCharge



15
# File 'lib/xrechnung/price.rb', line 15

member :allowance_charge, type: Xrechnung::AllowanceCharge

#base_quantityXrechnung::Quantity

Returns:



11
# File 'lib/xrechnung/price.rb', line 11

member :base_quantity, type: Xrechnung::Quantity

#price_amountXrechnung::Currency

Returns:



7
# File 'lib/xrechnung/price.rb', line 7

member :price_amount, type: Xrechnung::Currency

Instance Method Details

#to_xml(xml) ⇒ Object

noinspection RubyResolve



23
24
25
26
27
28
29
# File 'lib/xrechnung/price.rb', line 23

def to_xml(xml)
  xml.cac :Price do
    xml.cbc :PriceAmount, *price_amount.xml_args
    xml.cbc(:BaseQuantity, *base_quantity.xml_args) unless base_quantity.nil?
    allowance_charge&.to_xml(xml)
  end
end