Class: Eddy::TransactionSets::TS850::TS

Inherits:
Models::TransactionSet show all
Defined in:
lib/definitions/transaction_sets/manual/850/850.rb

Overview

Transaction Set Summary:

  • Id: 850
  • Name: Purchase Order
  • Functional Group: PO

Constant Summary collapse

ID =
"850".freeze
NAME =
"Purchase Order".freeze
FUNCTIONAL_GROUP =
"PO".freeze

Instance Attribute Summary

Attributes inherited from Models::TransactionSet

#components, #control_number, #store

Instance Method Summary collapse

Methods inherited from Models::TransactionSet

#add_envelope, #all_components, #functional_group, functional_group, id, #id, #name, name, #number_of_included_segments, #render

Constructor Details

#initialize(store) ⇒ void

Parameters:



18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# File 'lib/definitions/transaction_sets/manual/850/850.rb', line 18

def initialize(store)
  @beg = Eddy::Segments::BEG.new(store)
  @td5 = Eddy::Segments::TD5.new(store)
  @l_n1 = Eddy::TransactionSets::TS850::Loops::N1::Base.new(store)
  @l_po1 = Eddy::TransactionSets::TS850::Loops::PO1::Base.new(store)
  @ctt = Eddy::Segments::CTT.new(store)
  super(
    store,
    @beg,
    @td5,
    @l_n1,
    @l_po1,
    @ctt,
  )
end

Instance Method Details

#BEG {|| ... } ⇒ Eddy::Segments::BEG

Segment Summary:

  • Id: BEG
  • Name: Beginning Segment for Purchase Order
  • Purpose: To indicate the beginning of the Purchase Order Transaction Set and transmit identifying numbers and dates

Yield Parameters:

Returns:



38
39
40
41
# File 'lib/definitions/transaction_sets/manual/850/850.rb', line 38

def BEG()
  yield(@beg) if block_given?
  return @beg
end

#CTT {|| ... } ⇒ Eddy::Segments::CTT

Segment Summary:

  • Id: CTT
  • Name: Transaction Totals
  • Purpose: To transmit a hash total for a specific element in the transaction set

Yield Parameters:

Returns:



82
83
84
85
# File 'lib/definitions/transaction_sets/manual/850/850.rb', line 82

def CTT()
  yield(@ctt) if block_given?
  return @ctt
end

#L_N1 {|| ... } ⇒ void

This method returns an undefined value.

Loop Summary:

  • Repeat: 200
  • Components:
    • N1
    • N3
    • N4


56
57
58
59
60
61
62
63
# File 'lib/definitions/transaction_sets/manual/850/850.rb', line 56

def L_N1(&block)
  if block_given?
    @l_n1.repeat(&block)
  else
    raise Eddy::Errors::Error, "No block given in loop iteration"
  end
  return nil
end

#L_PO1 {|| ... } ⇒ void

This method returns an undefined value.

Loop Summary:

  • Repeat: 100,000
  • Components:
    • PO1


69
70
71
72
73
74
75
76
# File 'lib/definitions/transaction_sets/manual/850/850.rb', line 69

def L_PO1(&block)
  if block_given?
    @l_po1.repeat(&block)
  else
    raise Eddy::Errors::Error, "No block given in loop iteration"
  end
  return nil
end

#TD5 {|| ... } ⇒ Eddy::Segments::TD5

Segment Summary:

  • Id: TD5
  • Name: Carrier Details (Routing Sequence/Transit Time)
  • Purpose: To specify the carrier and sequence of routing and provide transit time information.

Yield Parameters:

Returns:



47
48
49
50
# File 'lib/definitions/transaction_sets/manual/850/850.rb', line 47

def TD5()
  yield(@td5) if block_given?
  return @td5
end