Class: Stupidedi::Versions::FunctionalGroups::FortyTen::ElementTypes::FloatVal::Empty

Inherits:
Stupidedi::Versions::FunctionalGroups::FortyTen::ElementTypes::FloatVal show all
Defined in:
lib/stupidedi/versions/functional_groups/004010/element_types/float_val.rb

Overview

Empty numeric value. Shouldn't be directly instantiated -- instead use the value and empty constructors.

Instance Attribute Summary

Attributes inherited from Stupidedi::Values::SimpleElementVal

#position, #usage

Instance Method Summary (collapse)

Methods inherited from Stupidedi::Versions::FunctionalGroups::FortyTen::ElementTypes::FloatVal

empty, #numeric?, #too_long?, #too_short?, value

Methods inherited from Stupidedi::Values::SimpleElementVal

#allowed?, #component?, #copy, #date?, #id?, #initialize, #leaf?, #numeric?, #simple?, #string?, #time?

Methods inherited from Stupidedi::Values::AbstractElementVal

#element?, #size

Methods inherited from Stupidedi::Values::AbstractVal

#blank?, #characters, #component?, #composite?, #definition, #element?, #functional_group?, #interchange?, #invalid?, #loop?, #present?, #repeated?, #segment?, #separator?, #simple?, #size, #table?, #transaction_set?, #transmission?

Methods included from Color

ansi, #ansi

Constructor Details

This class inherits a constructor from Stupidedi::Values::SimpleElementVal

Instance Method Details

- (Boolean) ==(other)

Returns:

  • (Boolean)


155
156
157
# File 'lib/stupidedi/versions/functional_groups/004010/element_types/float_val.rb', line 155

def ==(other)
  other.is_a?(Empty) or other.nil?
end

- (Boolean) empty?

Returns:

  • (Boolean)


118
119
120
# File 'lib/stupidedi/versions/functional_groups/004010/element_types/float_val.rb', line 118

def empty?
  true
end

- (String) inspect

Returns:



128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
# File 'lib/stupidedi/versions/functional_groups/004010/element_types/float_val.rb', line 128

def inspect
  id = definition.try 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(" R.empty#{id}")
end

- (FloatVal) map

Returns:



123
124
125
# File 'lib/stupidedi/versions/functional_groups/004010/element_types/float_val.rb', line 123

def map
  FloatVal.value(yield(nil), usage, position)
end

- (String) to_s

Returns:



145
146
147
# File 'lib/stupidedi/versions/functional_groups/004010/element_types/float_val.rb', line 145

def to_s
  ""
end

- (String) to_x12(truncate = true)

Returns:



150
151
152
# File 'lib/stupidedi/versions/functional_groups/004010/element_types/float_val.rb', line 150

def to_x12(truncate = true)
  ""
end

- (Boolean) valid?

Returns:

  • (Boolean)


114
115
116
# File 'lib/stupidedi/versions/functional_groups/004010/element_types/float_val.rb', line 114

def valid?
  true
end