Class: Eancom::Edifact::RTE
- Defined in:
- lib/eancom/edifact/segments/rte.rb
Constant Summary collapse
- TAG =
'RTE'.freeze
- TYPE =
:header
Instance Attribute Summary collapse
-
#segment_type ⇒ Object
readonly
Returns the value of attribute segment_type.
Attributes inherited from Segment
Instance Method Summary collapse
-
#initialize(tag: nil, rate_type_code_qualifier: nil, unit_price_basis_rate: nil) ⇒ RTE
constructor
A new instance of RTE.
- #to_json_hash ⇒ Object
Methods inherited from Segment
#array, #group_name, initialize_by_components, #is_body?, #is_footer?, #is_header?, #item_group_name, #starts_item?, #starts_message?, #structure, #tag?, #to_edi, #to_hash, #to_s, #validate_structure
Constructor Details
#initialize(tag: nil, rate_type_code_qualifier: nil, unit_price_basis_rate: nil) ⇒ RTE
Returns a new instance of RTE.
9 10 11 12 13 14 15 16 17 18 19 |
# File 'lib/eancom/edifact/segments/rte.rb', line 9 def initialize( tag: nil, rate_type_code_qualifier: nil, unit_price_basis_rate: nil ) @tag = tag @rate_type_code_qualifier = rate_type_code_qualifier @unit_price_basis_rate = unit_price_basis_rate super(tag: tag || TAG) end |
Instance Attribute Details
#segment_type ⇒ Object (readonly)
Returns the value of attribute segment_type.
7 8 9 |
# File 'lib/eancom/edifact/segments/rte.rb', line 7 def segment_type @segment_type end |
Instance Method Details
#to_json_hash ⇒ Object
21 22 23 24 25 26 |
# File 'lib/eancom/edifact/segments/rte.rb', line 21 def to_json_hash hash = {} hash.merge!(rate_type_code_qualifier: find_identifier(:rate_type_code_qualifier)) if @rate_type_code_qualifier hash.merge!(unit_price_basis_rate: @unit_price_basis_rate) if @unit_price_basis_rate hash end |