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

#==(other) ⇒ Boolean

Returns:

  • (Boolean)


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

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

#empty?Boolean

Returns:

  • (Boolean)


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

def empty?
  true
end

#inspectString

Returns:

  • (String)


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

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

#mapFloatVal

Returns:



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

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

#to_sString

Returns:

  • (String)


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

def to_s
  ""
end

#to_x12(truncate = true) ⇒ String

Returns:

  • (String)


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

def to_x12(truncate = true)
  ""
end

#valid?Boolean

Returns:

  • (Boolean)


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

def valid?
  true
end