Sha256: c7d9245e78529cfcf5c9a1d7c262854288ce01da1591abf2212c311138196ab8
Contents?: true
Size: 656 Bytes
Versions: 13
Compression:
Stored size: 656 Bytes
Contents
module Eancom module Edifact class Item attr_accessor :hash def initialize() @hash = {} end def << (segment) if name = group_name(segment) @hash[name] = [] if @hash[name].nil? @hash[name] << segment.to_json_hash else @hash.merge!(segment.to_json_hash) end end def to_json_hash @hash end def empty? @hash.empty? end private def group_name(segment) if segment.item_group_name segment.item_group_name else segment.group_name end end end end end
Version data entries
13 entries across 13 versions & 1 rubygems