Sha256: 638bc020ff12632be8c1830300f185ca22180ecb3ce4f59e43e285d5fdfa2d72
Contents?: true
Size: 1.71 KB
Versions: 15
Compression:
Stored size: 1.71 KB
Contents
module Eancom module Edifact class MEA < Segment TAG = 'MEA'.freeze TYPE = :body.freeze attr_reader :segment_type def initialize( tag: nil, measurement_purpose_code_qualifier:, measured_attribute_code:, measurement_significance_code: nil, measurment_unit_code:, measurement_value:, range_minimum_value: nil, range_maximum_value: nil ) @tag = tag @measurement_purpose_code_qualifier = measurement_purpose_code_qualifier @measured_attribute_code = measured_attribute_code @measurement_significance_code = measurement_significance_code @measurment_unit_code = measurment_unit_code @measurement_value = measurement_value @range_minimum_value = range_minimum_value @range_maximum_value = range_maximum_value super(tag: tag || TAG) end def to_json_hash hash = {} hash.merge!(measurement_purpose_code_qualifier: find_identifier(:measurement_purpose_code_qualifier)) if @measurement_purpose_code_qualifier hash.merge!(measured_attribute_code: find_identifier(:measured_attribute_code)) if @measured_attribute_code hash.merge!(measurement_significance_code: find_identifier(:measurement_significance_code)) if @measurement_significance_code hash.merge!(measurement_value: @measurement_value) if @measurement_value hash.merge!(range_minimum_value: @range_minimum_value) if @range_minimum_value hash.merge!(range_maximum_value: @range_maximum_value) if @range_maximum_value hash end def group_name 'characterisitcs' end def segment_type TYPE end end end end
Version data entries
15 entries across 15 versions & 1 rubygems