Class: EDI::Dir::Named_list

Inherits:
Object
  • Object
show all
Defined in:
lib/edi4r/standards.rb

Overview

Named_list:

A simplified Array to represent objects of EDI classes CDE, Segment, and Message (branches) as lists of their constituting sub-units, augmented by the common properties name and desc (description).

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeNamed_list

Returns a new instance of Named_list



66
67
68
# File 'lib/edi4r/standards.rb', line 66

def initialize
  @name, @desc, @store = nil, nil, []
end

Instance Attribute Details

#descObject

Returns the value of attribute desc



64
65
66
# File 'lib/edi4r/standards.rb', line 64

def desc
  @desc
end

#nameObject

Returns the value of attribute name



64
65
66
# File 'lib/edi4r/standards.rb', line 64

def name
  @name
end

Instance Method Details

#<<(obj) ⇒ Object



70
71
72
# File 'lib/edi4r/standards.rb', line 70

def <<(obj)
  @store << obj
end

#each(&b) ⇒ Object



74
75
76
# File 'lib/edi4r/standards.rb', line 74

def each( &b )
  @store.each( &b )
end

#empty?Boolean

Returns:

  • (Boolean)


82
83
84
# File 'lib/edi4r/standards.rb', line 82

def empty?
  @store.empty?
end

#sizeObject



78
79
80
# File 'lib/edi4r/standards.rb', line 78

def size
  @store.size
end