Class: ZATCA::UBL::CommonAggregateComponents::PostalAddress
- Inherits:
-
BaseComponent
- Object
- BaseComponent
- ZATCA::UBL::CommonAggregateComponents::PostalAddress
- Defined in:
- lib/zatca/ubl/common_aggregate_components/postal_address.rb
Constant Summary collapse
- SCHEMA =
Dry::Schema.Params do required(:street_name).filled(:string) required(:additional_street_name).filled(:string) required(:building_number).filled(:string) required(:plot_identification).filled(:string) required(:city_subdivision_name).filled(:string) required(:city_name).filled(:string) required(:postal_zone).filled(:string) required(:country_subentity).filled(:string) required(:country_identification_code).filled(:string) end
Constants inherited from BaseComponent
BaseComponent::ArrayOfBaseComponentOrNil
Instance Attribute Summary collapse
-
#additional_street_name ⇒ Object
Returns the value of attribute additional_street_name.
-
#building_number ⇒ Object
Returns the value of attribute building_number.
-
#city_name ⇒ Object
Returns the value of attribute city_name.
-
#city_subdivision_name ⇒ Object
Returns the value of attribute city_subdivision_name.
-
#country ⇒ Object
Returns the value of attribute country.
-
#country_subentity ⇒ Object
Returns the value of attribute country_subentity.
-
#plot_identification ⇒ Object
Returns the value of attribute plot_identification.
-
#postal_zone ⇒ Object
Returns the value of attribute postal_zone.
-
#street_name ⇒ Object
Returns the value of attribute street_name.
Attributes inherited from BaseComponent
Instance Method Summary collapse
- #elements ⇒ Object
-
#initialize(street_name:, building_number:, plot_identification:, city_subdivision_name:, city_name:, postal_zone:, country_subentity:, additional_street_name: nil, country_identification_code: "SA") ⇒ PostalAddress
constructor
A new instance of PostalAddress.
- #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(street_name:, building_number:, plot_identification:, city_subdivision_name:, city_name:, postal_zone:, country_subentity:, additional_street_name: nil, country_identification_code: "SA") ⇒ PostalAddress
Returns a new instance of PostalAddress.
24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 |
# File 'lib/zatca/ubl/common_aggregate_components/postal_address.rb', line 24 def initialize( street_name:, building_number:, plot_identification:, city_subdivision_name:, city_name:, postal_zone:, country_subentity:, additional_street_name: nil, country_identification_code: "SA" ) @street_name = street_name @additional_street_name = additional_street_name @building_number = building_number @plot_identification = plot_identification @city_subdivision_name = city_subdivision_name @city_name = city_name @postal_zone = postal_zone @country_subentity = country_subentity @country_identification_code = country_identification_code end |
Instance Attribute Details
#additional_street_name ⇒ Object
Returns the value of attribute additional_street_name.
2 3 4 |
# File 'lib/zatca/ubl/common_aggregate_components/postal_address.rb', line 2 def additional_street_name @additional_street_name end |
#building_number ⇒ Object
Returns the value of attribute building_number.
2 3 4 |
# File 'lib/zatca/ubl/common_aggregate_components/postal_address.rb', line 2 def building_number @building_number end |
#city_name ⇒ Object
Returns the value of attribute city_name.
2 3 4 |
# File 'lib/zatca/ubl/common_aggregate_components/postal_address.rb', line 2 def city_name @city_name end |
#city_subdivision_name ⇒ Object
Returns the value of attribute city_subdivision_name.
2 3 4 |
# File 'lib/zatca/ubl/common_aggregate_components/postal_address.rb', line 2 def city_subdivision_name @city_subdivision_name end |
#country ⇒ Object
Returns the value of attribute country.
2 3 4 |
# File 'lib/zatca/ubl/common_aggregate_components/postal_address.rb', line 2 def country @country end |
#country_subentity ⇒ Object
Returns the value of attribute country_subentity.
2 3 4 |
# File 'lib/zatca/ubl/common_aggregate_components/postal_address.rb', line 2 def country_subentity @country_subentity end |
#plot_identification ⇒ Object
Returns the value of attribute plot_identification.
2 3 4 |
# File 'lib/zatca/ubl/common_aggregate_components/postal_address.rb', line 2 def plot_identification @plot_identification end |
#postal_zone ⇒ Object
Returns the value of attribute postal_zone.
2 3 4 |
# File 'lib/zatca/ubl/common_aggregate_components/postal_address.rb', line 2 def postal_zone @postal_zone end |
#street_name ⇒ Object
Returns the value of attribute street_name.
2 3 4 |
# File 'lib/zatca/ubl/common_aggregate_components/postal_address.rb', line 2 def street_name @street_name end |
Instance Method Details
#elements ⇒ Object
44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 |
# File 'lib/zatca/ubl/common_aggregate_components/postal_address.rb', line 44 def elements [ ZATCA::UBL::BaseComponent.build(name: "cbc:StreetName", value: @street_name), ZATCA::UBL::BaseComponent.build(name: "cbc:AdditionalStreetName", value: @additional_street_name), ZATCA::UBL::BaseComponent.build(name: "cbc:BuildingNumber", value: @building_number), ZATCA::UBL::BaseComponent.build(name: "cbc:PlotIdentification", value: @plot_identification), ZATCA::UBL::BaseComponent.build(name: "cbc:CitySubdivisionName", value: @city_subdivision_name), ZATCA::UBL::BaseComponent.build(name: "cbc:CityName", value: @city_name), ZATCA::UBL::BaseComponent.build(name: "cbc:PostalZone", value: @postal_zone), ZATCA::UBL::BaseComponent.build(name: "cbc:CountrySubentity", value: @country_subentity), ZATCA::UBL::BaseComponent.build(name: "cac:Country", elements: [ ZATCA::UBL::BaseComponent.build(name: "cbc:IdentificationCode", value: @country_identification_code) ]) ] end |
#name ⇒ Object
40 41 42 |
# File 'lib/zatca/ubl/common_aggregate_components/postal_address.rb', line 40 def name "cac:PostalAddress" end |