Class: Stupidedi::Versions::Common::ElementTypes::FloatVal
Overview
Defined Under Namespace
Classes: Empty, Invalid, NonEmpty, Valid
Instance Attribute Summary
#position, #usage
Instance Method Summary
collapse
#allowed?, #component?, #copy, #date?, #id?, #initialize, #leaf?, #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
.empty(usage, position) ⇒ FloatVal
313
314
315
|
# File 'lib/stupidedi/versions/common/element_types/r.rb', line 313
def empty(usage, position)
self::Empty.new(usage, position)
end
|
.value(object, usage, position) ⇒ FloatVal
318
319
320
321
322
323
324
325
326
327
328
|
# File 'lib/stupidedi/versions/common/element_types/r.rb', line 318
def value(object, usage, position)
if object.is_a?(FloatVal)
object elsif object.blank?
self::Empty.new(usage, position)
else
self::NonEmpty.new(object.to_d, usage, position)
end
rescue ArgumentError
self::Invalid.new(object, usage, position)
end
|
Instance Method Details
#numeric? ⇒ Boolean
44
45
46
|
# File 'lib/stupidedi/versions/common/element_types/r.rb', line 44
def numeric?
true
end
|
#too_long? ⇒ Boolean
48
49
50
|
# File 'lib/stupidedi/versions/common/element_types/r.rb', line 48
def too_long?
false
end
|
#too_short? ⇒ Boolean
52
53
54
|
# File 'lib/stupidedi/versions/common/element_types/r.rb', line 52
def too_short?
false
end
|