Class: Stupidedi::Versions::Common::ElementTypes::FloatVal::Invalid

Inherits:
Stupidedi::Versions::Common::ElementTypes::FloatVal show all
Defined in:
lib/stupidedi/versions/common/element_types/r.rb

Instance Attribute Summary collapse

Attributes inherited from Stupidedi::Values::SimpleElementVal

#position, #usage

Instance Method Summary collapse

Methods inherited from Stupidedi::Versions::Common::ElementTypes::FloatVal

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

Methods inherited from Stupidedi::Values::SimpleElementVal

#allowed?, #component?, #date?, #id?, #leaf?, #numeric?, #simple?, #string?, #time?, #too_long?, #too_short?

Methods inherited from Stupidedi::Values::AbstractElementVal

#element?, #size

Methods inherited from Stupidedi::Values::AbstractVal

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

Methods included from Color

ansi, #ansi

Constructor Details

#initialize(value, usage, position) ⇒ Invalid

Returns a new instance of Invalid.


60
61
62
63
# File 'lib/stupidedi/versions/common/element_types/r.rb', line 60

def initialize(value, usage, position)
  @value = value
  super(usage, position)
end

Instance Attribute Details

#valueObject (readonly)

Returns:

  • (Object)

58
59
60
# File 'lib/stupidedi/versions/common/element_types/r.rb', line 58

def value
  @value
end

Instance Method Details

#==(other) ⇒ Boolean

Returns:

  • (Boolean)

108
109
110
# File 'lib/stupidedi/versions/common/element_types/r.rb', line 108

def ==(other)
  eql?(other)
end

#copy(changes = {}) ⇒ Invalid

Returns:


113
114
115
# File 'lib/stupidedi/versions/common/element_types/r.rb', line 113

def copy(changes = {})
  self
end

#empty?Boolean

Returns:

  • (Boolean)

69
70
71
# File 'lib/stupidedi/versions/common/element_types/r.rb', line 69

def empty?
  false
end

#inspectString

:nocov:

Returns:

  • (String)

80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
# File 'lib/stupidedi/versions/common/element_types/r.rb', line 80

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.invalid#{id}") + "(#{ansi.invalid(@value.inspect)})"
end

#mapFloatVal

Returns:


74
75
76
# File 'lib/stupidedi/versions/common/element_types/r.rb', line 74

def map
  self
end

#to_sString

Returns:

  • (String)

98
99
100
# File 'lib/stupidedi/versions/common/element_types/r.rb', line 98

def to_s
  ""
end

#to_x12(truncate = true) ⇒ String

Returns:

  • (String)

103
104
105
# File 'lib/stupidedi/versions/common/element_types/r.rb', line 103

def to_x12(truncate = true)
  ""
end

#valid?Boolean

Returns:

  • (Boolean)

65
66
67
# File 'lib/stupidedi/versions/common/element_types/r.rb', line 65

def valid?
  false
end