Class: ZATCA::UBL::CommonAggregateComponents::Item
- Inherits:
-
BaseComponent
- Object
- BaseComponent
- ZATCA::UBL::CommonAggregateComponents::Item
- Defined in:
- lib/zatca/ubl/common_aggregate_components/item.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(name:, classified_tax_category: nil) ⇒ Item
constructor
A new instance of Item.
- #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(name:, classified_tax_category: nil) ⇒ Item
Returns a new instance of Item.
4 5 6 7 8 9 |
# File 'lib/zatca/ubl/common_aggregate_components/item.rb', line 4 def initialize(name:, classified_tax_category: nil) super() @name = name @classified_tax_category = classified_tax_category || ZATCA::UBL::CommonAggregateComponents::ClassifiedTaxCategory.new end |
Instance Attribute Details
#id ⇒ Object (readonly)
Returns the value of attribute id.
2 3 4 |
# File 'lib/zatca/ubl/common_aggregate_components/item.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/item.rb', line 2 def scheme_id @scheme_id end |
Instance Method Details
#elements ⇒ Object
15 16 17 18 19 20 |
# File 'lib/zatca/ubl/common_aggregate_components/item.rb', line 15 def elements [ ZATCA::UBL::BaseComponent.new(name: "cbc:Name", value: @name), @classified_tax_category ] end |
#name ⇒ Object
11 12 13 |
# File 'lib/zatca/ubl/common_aggregate_components/item.rb', line 11 def name "cac:Item" end |