Sha256: 013073d4a8af56bb71325ce420a1777d2ca7ec064a0043c8d3f141ea775855bc

Contents?: true

Size: 1.32 KB

Versions: 6

Compression:

Stored size: 1.32 KB

Contents

# frozen_string_literal: true

module CXML
  # body header of purchase order request
  class OrderRequestHeader < DocumentNode
    accessible_attributes %i[
      agreement_id
      agreement_payload_id
      effective_date
      expiration_date
      is_internal_version
      order_date
      order_id
      order_type
      order_version
      parent_agreement_id
      parent_agreement_payload_id
      pick_up_date
      release_required
      requested_delivery_date
      requisition_id
      ship_complete
      type
    ]
    accessible_nodes %i[
      total
      ship_to
      bill_to
      shipping
      tax
      payment
      payment_term
      contact
      comments
      followup
      document_reference
      supplier_order_info
      extrinsics
      control_keys
      delivery_period
      followup
      id_reference
      legal_identity
      order_request_header_industry
      organizational_unit
      terms_of_delivery
    ]

    def type
      @type || 'new'
    end

    def initialize_extrinsic(value)
      value = [value] unless value.is_a?(Array)
      @extrinsics = value.map do |item|
        Extrinsic.new(item)
      end
    end

    def initialize_extrinsics(value)
      value = [value] unless value.is_a?(Array)
      @extrinsics = value.map do |item|
        Extrinsic.new(item)
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
cxml-ruby-0.8.2 lib/cxml/order_request_header.rb
cxml-ruby-0.8.1 lib/cxml/order_request_header.rb
cxml-ruby-0.8.0 lib/cxml/order_request_header.rb
cxml-ruby-0.7.0 lib/cxml/order_request_header.rb
cxml-ruby-0.6.1 lib/cxml/order_request_header.rb
cxml-ruby-0.6.0 lib/cxml/order_request_header.rb