Class: ZATCA::UBL::CommonAggregateComponents::Delivery
- Inherits:
-
BaseComponent
- Object
- BaseComponent
- ZATCA::UBL::CommonAggregateComponents::Delivery
- Defined in:
- lib/zatca/ubl/common_aggregate_components/delivery.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(actual_delivery_date:, latest_delivery_date: nil) ⇒ Delivery
constructor
A new instance of Delivery.
- #latest_delivery_date_element ⇒ Object
- #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(actual_delivery_date:, latest_delivery_date: nil) ⇒ Delivery
Returns a new instance of Delivery.
4 5 6 7 8 9 |
# File 'lib/zatca/ubl/common_aggregate_components/delivery.rb', line 4 def initialize(actual_delivery_date:, latest_delivery_date: nil) super() @latest_delivery_date = latest_delivery_date @actual_delivery_date = actual_delivery_date end |
Instance Attribute Details
#id ⇒ Object (readonly)
Returns the value of attribute id.
2 3 4 |
# File 'lib/zatca/ubl/common_aggregate_components/delivery.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/delivery.rb', line 2 def scheme_id @scheme_id end |
Instance Method Details
#elements ⇒ Object
21 22 23 24 25 26 |
# File 'lib/zatca/ubl/common_aggregate_components/delivery.rb', line 21 def elements [ ZATCA::UBL::BaseComponent.new(name: "cbc:ActualDeliveryDate", value: @actual_delivery_date), latest_delivery_date_element ] end |
#latest_delivery_date_element ⇒ Object
15 16 17 18 19 |
# File 'lib/zatca/ubl/common_aggregate_components/delivery.rb', line 15 def latest_delivery_date_element return nil if @latest_delivery_date.nil? ZATCA::UBL::BaseComponent.new(name: "cbc:LatestDeliveryDate", value: @latest_delivery_date) end |
#name ⇒ Object
11 12 13 |
# File 'lib/zatca/ubl/common_aggregate_components/delivery.rb', line 11 def name "cac:Delivery" end |