Class: Stupidedi::Versions::Interchanges::TwoHundred::ElementDefs::SeparatorElementVal
Instance Attribute Summary
#position, #usage
Instance Method Summary
collapse
#allowed?, #component?, #date?, #id?, #leaf?, #numeric?, #simple?, #string?, #time?
#element?, #size
#blank?, #characters, #component?, #composite?, #definition, #element?, #functional_group?, #interchange?, #invalid?, #loop?, #present?, #repeated?, #segment?, #simple?, #size, #table?, #transaction_set?, #transmission?
Methods included from Color
ansi, #ansi
Constructor Details
Returns a new instance of SeparatorElementVal.
59
60
61
62
|
# File 'lib/stupidedi/versions/interchanges/00200/element_defs.rb', line 59
def initialize(value, usage, position)
@value = value
super(usage, position)
end
|
Class Method Details
.empty(usage, position) ⇒ Object
108
109
110
|
# File 'lib/stupidedi/versions/interchanges/00200/element_defs.rb', line 108
def empty(usage, position)
SeparatorElementVal.new(nil, usage, position)
end
|
118
119
120
|
# File 'lib/stupidedi/versions/interchanges/00200/element_defs.rb', line 118
def parse(character, usage, position)
SeparatorElementVal.new(character, usage, position)
end
|
113
114
115
|
# File 'lib/stupidedi/versions/interchanges/00200/element_defs.rb', line 113
def value(character, usage, position)
SeparatorElementVal.new(character, usage, position)
end
|
Instance Method Details
65
66
67
68
69
70
|
# File 'lib/stupidedi/versions/interchanges/00200/element_defs.rb', line 65
def copy(changes = {})
SeparatorElementVal.new \
changes.fetch(:value, @value),
changes.fetch(:usage, usage),
changes.fetch(:position, position)
end
|
#empty? ⇒ Boolean
76
77
78
|
# File 'lib/stupidedi/versions/interchanges/00200/element_defs.rb', line 76
def empty?
@value.blank?
end
|
97
98
99
100
|
# File 'lib/stupidedi/versions/interchanges/00200/element_defs.rb', line 97
def inspect
id = definition.try{|d| ansi.bold("[#{d.id}]") }
ansi.element("SeparatorElementVal.value#{id}") << "(#{@value || "nil"})"
end
|
#separator? ⇒ Boolean
88
89
90
|
# File 'lib/stupidedi/versions/interchanges/00200/element_defs.rb', line 88
def separator?
true
end
|
93
94
95
|
# File 'lib/stupidedi/versions/interchanges/00200/element_defs.rb', line 93
def to_x12
@value.to_s
end
|
#too_long? ⇒ Boolean
84
85
86
|
# File 'lib/stupidedi/versions/interchanges/00200/element_defs.rb', line 84
def too_long?
@value.length > 1
end
|
#too_short? ⇒ Boolean
80
81
82
|
# File 'lib/stupidedi/versions/interchanges/00200/element_defs.rb', line 80
def too_short?
@value.length < 1
end
|
#valid? ⇒ Boolean
72
73
74
|
# File 'lib/stupidedi/versions/interchanges/00200/element_defs.rb', line 72
def valid?
true
end
|