Class: ZATCA::UBL::CommonAggregateComponents::ClassifiedTaxCategory
- Inherits:
-
BaseComponent
- Object
- BaseComponent
- ZATCA::UBL::CommonAggregateComponents::ClassifiedTaxCategory
- Defined in:
- lib/zatca/ubl/common_aggregate_components/classified_tax_category.rb
Constant Summary
Constants inherited from BaseComponent
BaseComponent::ArrayOfBaseComponentOrNil
Instance Attribute Summary collapse
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#scheme_id ⇒ Object
readonly
Returns the value of attribute scheme_id.
Attributes inherited from BaseComponent
Instance Method Summary collapse
- #elements ⇒ Object
-
#initialize(id: "S", percent: "15.00", tax_scheme_id: "VAT") ⇒ ClassifiedTaxCategory
constructor
A new instance of ClassifiedTaxCategory.
- #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(id: "S", percent: "15.00", tax_scheme_id: "VAT") ⇒ ClassifiedTaxCategory
Returns a new instance of ClassifiedTaxCategory.
4 5 6 7 8 9 10 |
# File 'lib/zatca/ubl/common_aggregate_components/classified_tax_category.rb', line 4 def initialize(id: "S", percent: "15.00", tax_scheme_id: "VAT") super() @id = id @percent = percent @tax_scheme_id = tax_scheme_id end |
Instance Attribute Details
#id ⇒ Object (readonly)
Returns the value of attribute id.
2 3 4 |
# File 'lib/zatca/ubl/common_aggregate_components/classified_tax_category.rb', line 2 def id @id end |
#scheme_id ⇒ Object (readonly)
Returns the value of attribute scheme_id.
2 3 4 |
# File 'lib/zatca/ubl/common_aggregate_components/classified_tax_category.rb', line 2 def scheme_id @scheme_id end |
Instance Method Details
#elements ⇒ Object
16 17 18 19 20 21 22 23 24 |
# File 'lib/zatca/ubl/common_aggregate_components/classified_tax_category.rb', line 16 def elements [ ZATCA::UBL::BaseComponent.new(name: "cbc:ID", value: @id), ZATCA::UBL::BaseComponent.new(name: "cbc:Percent", value: @percent), ZATCA::UBL::BaseComponent.new(name: "cac:TaxScheme", elements: [ ZATCA::UBL::BaseComponent.new(name: "cbc:ID", value: @tax_scheme_id) ]) ] end |
#name ⇒ Object
12 13 14 |
# File 'lib/zatca/ubl/common_aggregate_components/classified_tax_category.rb', line 12 def name "cac:ClassifiedTaxCategory" end |