class Eancom::Edifact::PCD

Constants

TAG
TYPE

Attributes

segment_type[R]

Public Class Methods

new( tag: nil, percentage:, percentage_type_code_qualifier: nil ) click to toggle source
Calls superclass method Eancom::Edifact::Segment::new
# File lib/eancom/edifact/segments/pcd.rb, line 9
def initialize(
  tag: nil,
  percentage:,
  percentage_type_code_qualifier: nil
)
  @tag = tag
  @percentage_type_code_qualifier = percentage_type_code_qualifier
  @percentage = percentage

  super(tag: tag || TAG)
end

Public Instance Methods

to_json_hash() click to toggle source
# File lib/eancom/edifact/segments/pcd.rb, line 21
def to_json_hash
  hash = {}
  hash.merge!(percentage_type_code_qualifier: find_identifier(:percentage_type_code_qualifier)) if @percentage_type_code_qualifier
  hash.merge!(percentage: @percentage) if @percentage
  hash
end