Class: Stupidedi::Versions::FunctionalGroups::TwoThousandOne::ElementTypes::StringVal
Overview
Defined Under Namespace
Classes: Empty, Invalid, NonEmpty
Instance Attribute Summary
#position, #usage
Instance Method Summary
collapse
#allowed?, #component?, #copy, #date?, #id?, #initialize, #leaf?, #numeric?, #simple?, #time?, #to_x12
#element?, #size
#blank?, #characters, #component?, #composite?, #definition, #element?, #empty?, #functional_group?, #interchange?, #invalid?, #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
.empty(usage, position) ⇒ StringVal
365
366
367
|
# File 'lib/stupidedi/versions/functional_groups/002001/element_types/string_val.rb', line 365
def empty(usage, position)
self::Empty.new(usage, position)
end
|
.value(object, usage, position) ⇒ StringVal
370
371
372
373
374
375
376
377
378
|
# File 'lib/stupidedi/versions/functional_groups/002001/element_types/string_val.rb', line 370
def value(object, usage, position)
if 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
34
35
36
|
# File 'lib/stupidedi/versions/functional_groups/002001/element_types/string_val.rb', line 34
def map
StringVal.value(yield(value), usage, position)
end
|
#string? ⇒ Boolean
21
22
23
|
# File 'lib/stupidedi/versions/functional_groups/002001/element_types/string_val.rb', line 21
def string?
true
end
|
#too_long? ⇒ Boolean
25
26
27
|
# File 'lib/stupidedi/versions/functional_groups/002001/element_types/string_val.rb', line 25
def too_long?
false
end
|
#too_short? ⇒ Boolean
29
30
31
|
# File 'lib/stupidedi/versions/functional_groups/002001/element_types/string_val.rb', line 29
def too_short?
false
end
|