Sha256: 899845a46144f2d61bcc57671ee2c0ca56139180a39a35c7fe63f31f5453d1e6
Contents?: true
Size: 1.3 KB
Versions: 15
Compression:
Stored size: 1.3 KB
Contents
module Eancom module Edifact class MOA < Segment TAG = 'MOA'.freeze TYPE = :body.freeze attr_reader :segment_type def initialize( tag: nil, monetary_amount_type_code_qualifier:, monetary_amount:, currency_identification_code: nil, currency_type_code_qualifier: nil ) @tag = tag @monetary_amount_type_code_qualifier = monetary_amount_type_code_qualifier @monetary_amount= monetary_amount @currency_identification_code = currency_identification_code @currency_type_code_qualifier = currency_type_code_qualifier super(tag: tag || TAG) end def to_json_hash hash = {} hash.merge!(monetary_amount_type_code_qualifier: find_identifier(:monetary_amount_type_code_qualifier)) if @monetary_amount_type_code_qualifier hash.merge!(monetary_amount: @monetary_amount) if @monetary_amount hash.merge!(currency_identification_code: @currency_identification_code) if @currency_identification_code hash.merge!(currency_type_code_qualifier: find_identifier(@currency_type_code_qualifier)) if @currency_type_code_qualifier hash end def group_name 'monetary_amounts' end def segment_type TYPE end end end end
Version data entries
15 entries across 15 versions & 1 rubygems