Class: Eancom::Edifact::INV
- Defined in:
- lib/eancom/edifact/segments/inv.rb
Constant Summary collapse
- TAG =
'INV'.freeze
- TYPE =
:body
Instance Attribute Summary collapse
-
#segment_type ⇒ Object
readonly
Returns the value of attribute segment_type.
Attributes inherited from Segment
Instance Method Summary collapse
- #group_name ⇒ Object
-
#initialize(tag: nil, inventory_movement_direction_code:, inventory_type_code: nil, inventory_movement_reason_code: nil, inventory_balance_method_code: nil) ⇒ INV
constructor
A new instance of INV.
- #to_json_hash ⇒ Object
Methods inherited from Segment
#array, 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, inventory_movement_direction_code:, inventory_type_code: nil, inventory_movement_reason_code: nil, inventory_balance_method_code: nil) ⇒ INV
Returns a new instance of INV.
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/eancom/edifact/segments/inv.rb', line 9 def initialize( tag: nil, inventory_movement_direction_code:, inventory_type_code: nil, inventory_movement_reason_code: nil, inventory_balance_method_code: nil ) @tag = tag @inventory_movement_direction_code = inventory_movement_direction_code @inventory_type_code = inventory_type_code @inventory_movement_reason_code = inventory_movement_reason_code @inventory_balance_method_code = inventory_balance_method_code 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/inv.rb', line 7 def segment_type @segment_type end |
Instance Method Details
#group_name ⇒ Object
34 35 36 |
# File 'lib/eancom/edifact/segments/inv.rb', line 34 def group_name 'inventory' end |
#to_json_hash ⇒ Object
25 26 27 28 29 30 31 32 |
# File 'lib/eancom/edifact/segments/inv.rb', line 25 def to_json_hash hash = {} hash.merge!(inventory_movement_direction_code: find_identifier(:inventory_movement_direction_code)) if @inventory_movement_direction_code hash.merge!(inventory_type_code: @inventory_type_code) if @inventory_type_code hash.merge!(inventory_movement_reason_code: @inventory_movement_reason_code) if @inventory_movement_reason_code hash.merge!(inventory_balance_method_code: @inventory_balance_method_code) if @inventory_balance_method_code hash end |