Class: ZATCA::UBL::CommonAggregateComponents::Price
- Inherits:
-
BaseComponent
- Object
- BaseComponent
- ZATCA::UBL::CommonAggregateComponents::Price
- Defined in:
- lib/zatca/ubl/common_aggregate_components/price.rb
Constant Summary
Constants inherited from BaseComponent
BaseComponent::ArrayOfBaseComponentOrNil
Instance Attribute Summary
Attributes inherited from BaseComponent
Instance Method Summary collapse
- #elements ⇒ Object
-
#initialize(price_amount:, allowance_charge: nil, currency_id: "SAR") ⇒ Price
constructor
A new instance of Price.
- #name ⇒ Object
Methods inherited from BaseComponent
#[], build, #build_xml, #dig, #find_nested_element_by_path, #generate_xml, #schema, #to_h, #to_xml
Constructor Details
#initialize(price_amount:, allowance_charge: nil, currency_id: "SAR") ⇒ Price
Returns a new instance of Price.
2 3 4 5 6 7 8 |
# File 'lib/zatca/ubl/common_aggregate_components/price.rb', line 2 def initialize(price_amount:, allowance_charge: nil, currency_id: "SAR") super() @price_amount = price_amount @allowance_charge = allowance_charge @currency_id = currency_id end |
Instance Method Details
#elements ⇒ Object
14 15 16 17 18 19 |
# File 'lib/zatca/ubl/common_aggregate_components/price.rb', line 14 def elements [ ZATCA::UBL::BaseComponent.new(name: "cbc:PriceAmount", value: @price_amount, attributes: {currencyID: @currency_id}), @allowance_charge ] end |
#name ⇒ Object
10 11 12 |
# File 'lib/zatca/ubl/common_aggregate_components/price.rb', line 10 def name "cac:Price" end |