class Eancom::Edifact::PAC

Constants

TAG
TYPE

Public Class Methods

new( tag: nil, package_quantity: nil, packaging_level_code: nil, packaging_related_description_code: nil, packaging_terms_and_conditions: nil, package_type_description_code: nil, code_list_identification_code: nil, code_list_responsible_agency_code: nil, type_of_packages: nil, description_format_code: nil, type_of_packages_1: nil, item_type_identification_code_1: nil, type_of_packages_2: nil, item_type_identification_code_2: nil, returnable_package_freight_payment_responsibility_code: nil, returnable_package_load_contents_code: nil ) click to toggle source
Calls superclass method Eancom::Edifact::Segment::new
# File lib/eancom/edifact/segments/pac.rb, line 7
def initialize(
  tag: nil,
  package_quantity: nil,
  packaging_level_code: nil,
  packaging_related_description_code: nil,
  packaging_terms_and_conditions: nil,
  package_type_description_code: nil,
  code_list_identification_code: nil,
  code_list_responsible_agency_code: nil,
  type_of_packages: nil,
  description_format_code: nil,
  type_of_packages_1: nil,
  item_type_identification_code_1: nil,
  type_of_packages_2: nil,
  item_type_identification_code_2: nil,
  returnable_package_freight_payment_responsibility_code: nil,
  returnable_package_load_contents_code: nil
)
  @tag = tag
  @package_quantity = package_quantity
  @packaging_level_code = packaging_level_code
  @packaging_related_description_code = packaging_related_description_code
  @packaging_terms_and_conditions = packaging_terms_and_conditions
  @package_type_description_code = package_type_description_code
  @code_list_identification_code = code_list_identification_code
  @code_list_responsible_agency_code = code_list_responsible_agency_code
  @type_of_packages = type_of_packages
  @description_format_code = description_format_code
  @type_of_packages_1 = type_of_packages_1
  @item_type_identification_code_1 = item_type_identification_code_1
  @type_of_packages_2 = type_of_packages_2
  @item_type_identification_code_2 = item_type_identification_code_2
  @returnable_package_freight_payment_responsibility_code = returnable_package_freight_payment_responsibility_code
  @returnable_package_load_contents_code = returnable_package_load_contents_code

  super(tag: tag || TAG)
end

Public Instance Methods

segment_type() click to toggle source
# File lib/eancom/edifact/segments/pac.rb, line 51
def segment_type
  TYPE
end
to_json_hash() click to toggle source
# File lib/eancom/edifact/segments/pac.rb, line 45
def to_json_hash
  hash = {}
  hash.merge!(package_quantity: @package_quantity) if @package_quantity
  hash
end