Class: Stupidedi::Versions::Common::ElementTypes::IdentifierVal
Overview
Defined Under Namespace
Classes: Empty, Invalid, NonEmpty, Valid
Instance Attribute Summary
#position, #usage
Instance Method Summary
collapse
#allowed?, #component?, #copy, #date?, #initialize, #leaf?, #numeric?, #simple?, #string?, #time?, #to_s, #to_x12, #valid?
#element?, #size
#blank?, #characters, #component?, #composite?, #definition, #descriptor, #element?, #empty?, #functional_group?, #interchange?, #invalid?, #leaf?, #loop?, #present?, #repeated?, #segment?, #separator?, #simple?, #size, #table?, #transaction_set?, #transmission?, #valid?
Methods included from Color
ansi, #ansi
Methods included from Inspect
#inspect
Class Method Details
275
276
277
|
# File 'lib/stupidedi/versions/common/element_types/id.rb', line 275
def empty(usage, position)
self::Empty.new(usage, position)
end
|
.value(object, usage, position) ⇒ IdentifierVal
280
281
282
283
284
285
286
287
288
289
290
|
# File 'lib/stupidedi/versions/common/element_types/id.rb', line 280
def value(object, usage, position)
if object.is_a?(IdentifierVal)
object elsif object.blank?
self::Empty.new(usage, position)
else
self::NonEmpty.new(object.to_s.rstrip, usage, position)
end
rescue
self::Invalid.new(object, usage, position)
end
|
Instance Method Details
#id? ⇒ Boolean
56
57
58
|
# File 'lib/stupidedi/versions/common/element_types/id.rb', line 56
def id?
true
end
|
#too_long? ⇒ Boolean
60
61
62
|
# File 'lib/stupidedi/versions/common/element_types/id.rb', line 60
def too_long?
false
end
|
#too_short? ⇒ Boolean
64
65
66
|
# File 'lib/stupidedi/versions/common/element_types/id.rb', line 64
def too_short?
false
end
|