Class: Stupidedi::Versions::Interchanges::FourOhOne::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.
62
63
64
65
|
# File 'lib/stupidedi/versions/interchanges/00401/element_defs.rb', line 62
def initialize(value, usage, position)
@value = value
super(usage, position)
end
|
Class Method Details
.empty(usage, position) ⇒ Object
111
112
113
|
# File 'lib/stupidedi/versions/interchanges/00401/element_defs.rb', line 111
def empty(usage, position)
SeparatorElementVal.new(nil, usage, position)
end
|
121
122
123
|
# File 'lib/stupidedi/versions/interchanges/00401/element_defs.rb', line 121
def parse(character, usage, position)
SeparatorElementVal.new(character, usage, position)
end
|
116
117
118
|
# File 'lib/stupidedi/versions/interchanges/00401/element_defs.rb', line 116
def value(character, usage, position)
SeparatorElementVal.new(character, usage, position)
end
|
Instance Method Details
68
69
70
71
72
73
|
# File 'lib/stupidedi/versions/interchanges/00401/element_defs.rb', line 68
def copy(changes = {})
SeparatorElementVal.new \
changes.fetch(:value, @value),
changes.fetch(:usage, usage),
changes.fetch(:position, position)
end
|
#empty? ⇒ Boolean
79
80
81
|
# File 'lib/stupidedi/versions/interchanges/00401/element_defs.rb', line 79
def empty?
@value.blank?
end
|
#inspect ⇒ Object
100
101
102
103
|
# File 'lib/stupidedi/versions/interchanges/00401/element_defs.rb', line 100
def inspect
id = definition.try{|d| ansi.bold("[#{d.id}]") }
ansi.element("SeparatorElementVal.value#{id}") << "(#{@value || "nil"})"
end
|
#separator? ⇒ Boolean
91
92
93
|
# File 'lib/stupidedi/versions/interchanges/00401/element_defs.rb', line 91
def separator?
true
end
|
#to_x12 ⇒ String
96
97
98
|
# File 'lib/stupidedi/versions/interchanges/00401/element_defs.rb', line 96
def to_x12
@value.to_s
end
|
#too_long? ⇒ Boolean
87
88
89
|
# File 'lib/stupidedi/versions/interchanges/00401/element_defs.rb', line 87
def too_long?
@value.length > 1
end
|
#too_short? ⇒ Boolean
83
84
85
|
# File 'lib/stupidedi/versions/interchanges/00401/element_defs.rb', line 83
def too_short?
@value.length < 1
end
|
#valid? ⇒ Boolean
75
76
77
|
# File 'lib/stupidedi/versions/interchanges/00401/element_defs.rb', line 75
def valid?
true
end
|