Class: Stupidedi::Versions::Common::ElementTypes::TimeVal::Invalid

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

Instance Attribute Summary collapse

Attributes inherited from Stupidedi::Values::SimpleElementVal

#position, #usage

Instance Method Summary collapse

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

empty, #time?, #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.


48
49
50
51
# File 'lib/stupidedi/versions/common/element_types/tm.rb', line 48

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

Instance Attribute Details

#valueObject (readonly)

Returns:

  • (Object)

46
47
48
# File 'lib/stupidedi/versions/common/element_types/tm.rb', line 46

def value
  @value
end

Instance Method Details

#==(other) ⇒ Boolean

Returns:

  • (Boolean)

96
97
98
# File 'lib/stupidedi/versions/common/element_types/tm.rb', line 96

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

#copy(changes = {})


100
101
102
# File 'lib/stupidedi/versions/common/element_types/tm.rb', line 100

def copy(changes = {})
  self
end

#empty?Boolean

Returns:

  • (Boolean)

57
58
59
# File 'lib/stupidedi/versions/common/element_types/tm.rb', line 57

def empty?
  false
end

#inspectString

:nocov:

Returns:

  • (String)

68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
# File 'lib/stupidedi/versions/common/element_types/tm.rb', line 68

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

#mapTimeVal

Returns:


62
63
64
# File 'lib/stupidedi/versions/common/element_types/tm.rb', line 62

def map
  self
end

#to_sString

Returns:

  • (String)

86
87
88
# File 'lib/stupidedi/versions/common/element_types/tm.rb', line 86

def to_s
  ""
end

#to_x12(truncate = true) ⇒ String

Returns:

  • (String)

91
92
93
# File 'lib/stupidedi/versions/common/element_types/tm.rb', line 91

def to_x12(truncate = true)
  ""
end

#valid?Boolean

Returns:

  • (Boolean)

53
54
55
# File 'lib/stupidedi/versions/common/element_types/tm.rb', line 53

def valid?
  false
end