Class: ZATCA::UBL::CommonAggregateComponents::PartyIdentification
- Inherits:
-
BaseComponent
- Object
- BaseComponent
- ZATCA::UBL::CommonAggregateComponents::PartyIdentification
- Defined in:
- lib/zatca/ubl/common_aggregate_components/party_identification.rb
Constant Summary collapse
- SCHEMA =
Dry::Schema.Params do required(:id).filled(:string) required(:scheme_id).filled(:string) end
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:, scheme_id: "CRN") ⇒ PartyIdentification
constructor
A new instance of PartyIdentification.
- #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:, scheme_id: "CRN") ⇒ PartyIdentification
Returns a new instance of PartyIdentification.
9 10 11 12 13 14 |
# File 'lib/zatca/ubl/common_aggregate_components/party_identification.rb', line 9 def initialize(id:, scheme_id: "CRN") super() @id = id @scheme_id = 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/party_identification.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/party_identification.rb', line 2 def scheme_id @scheme_id end |
Instance Method Details
#elements ⇒ Object
20 21 22 23 24 |
# File 'lib/zatca/ubl/common_aggregate_components/party_identification.rb', line 20 def elements [ ZATCA::UBL::BaseComponent.new(name: "cbc:ID", value: @id, attributes: {"schemeID" => @scheme_id}) ] end |
#name ⇒ Object
16 17 18 |
# File 'lib/zatca/ubl/common_aggregate_components/party_identification.rb', line 16 def name "cac:PartyIdentification" end |