Class: Stupidedi::Versions::FunctionalGroups::FortyTen::ElementTypes::TimeVal::Invalid

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

Instance Attribute Summary collapse

Attributes inherited from Stupidedi::Values::SimpleElementVal

#position, #usage

Instance Method Summary collapse

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

empty, #time?, #too_long?, #too_short?, value

Methods inherited from Stupidedi::Values::SimpleElementVal

#allowed?, #component?, #copy, #date?, #id?, #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

#initialize(value, usage, position) ⇒ Invalid

Returns a new instance of Invalid



51
52
53
54
# File 'lib/stupidedi/versions/functional_groups/004010/element_types/time_val.rb', line 51

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

Instance Attribute Details

#valueObject (readonly)

Returns:

  • (Object)


49
50
51
# File 'lib/stupidedi/versions/functional_groups/004010/element_types/time_val.rb', line 49

def value
  @value
end

Instance Method Details

#==(other) ⇒ Boolean

Returns:

  • (Boolean)


92
93
94
# File 'lib/stupidedi/versions/functional_groups/004010/element_types/time_val.rb', line 92

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

#empty?Boolean

Returns:

  • (Boolean)


60
61
62
# File 'lib/stupidedi/versions/functional_groups/004010/element_types/time_val.rb', line 60

def empty?
  false
end

#inspectString

Returns:

  • (String)


65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
# File 'lib/stupidedi/versions/functional_groups/004010/element_types/time_val.rb', line 65

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

#to_sString

Returns:

  • (String)


82
83
84
# File 'lib/stupidedi/versions/functional_groups/004010/element_types/time_val.rb', line 82

def to_s
  ""
end

#to_x12(truncate = true) ⇒ String

Returns:

  • (String)


87
88
89
# File 'lib/stupidedi/versions/functional_groups/004010/element_types/time_val.rb', line 87

def to_x12(truncate = true)
  ""
end

#valid?Boolean

Returns:

  • (Boolean)


56
57
58
# File 'lib/stupidedi/versions/functional_groups/004010/element_types/time_val.rb', line 56

def valid?
  false
end