Class: Stupidedi::Versions::FunctionalGroups::FortyTen::ElementTypes::StringVal::Empty
Overview
Empty string value. Shouldn’t be directly instantiated – instead, use the empty constructor.
Instance Attribute Summary
#position, #usage
Instance Method Summary
collapse
wrappers
unary_operators
relational_operators
empty, #map, #string?, #too_long?, #too_short?, value
#allowed?, #component?, #date?, #id?, #initialize, #leaf?, #numeric?, #simple?, #string?, #time?
#element?, #size
#blank?, #characters, #component?, #composite?, #definition, #element?, #empty?, #functional_group?, #interchange?, #invalid?, #loop?, #present?, #repeated?, #segment?, #separator?, #simple?, #size, #table?, #transaction_set?, #transmission?
Methods included from Color
ansi, #ansi
Instance Method Details
#coerce(other) ⇒ Object
141
142
143
144
145
|
# File 'lib/stupidedi/versions/functional_groups/004010/element_types/string_val.rb', line 141
def coerce(other)
return copy(:value => other.to_str), self
end
|
134
135
136
137
138
139
|
# File 'lib/stupidedi/versions/functional_groups/004010/element_types/string_val.rb', line 134
def copy(changes = {})
StringVal.value \
changes.fetch(:value, value),
changes.fetch(:usage, usage),
changes.fetch(:position, position)
end
|
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
|
# File 'lib/stupidedi/versions/functional_groups/004010/element_types/string_val.rb', line 156
def inspect
id = definition.bind do |d|
"[#{'% 5s' % d.id}: #{d.name}]".bind do |s|
if usage.forbidden?
ansi.forbidden(s)
elsif usage.required?
ansi.required(s)
else
ansi.optional(s)
end
end
end
ansi.element("AN.empty#{id}")
end
|
173
174
175
|
# File 'lib/stupidedi/versions/functional_groups/004010/element_types/string_val.rb', line 173
def to_s
""
end
|
#to_x12(truncate = true) ⇒ String
178
179
180
|
# File 'lib/stupidedi/versions/functional_groups/004010/element_types/string_val.rb', line 178
def to_x12(truncate = true)
""
end
|
#valid? ⇒ Boolean
151
152
153
|
# File 'lib/stupidedi/versions/functional_groups/004010/element_types/string_val.rb', line 151
def valid?
true
end
|
147
148
149
|
# File 'lib/stupidedi/versions/functional_groups/004010/element_types/string_val.rb', line 147
def value
""
end
|