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

- (Invalid) initialize(value, usage, position)

Returns a new instance of Invalid



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

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

Instance Attribute Details

- (Object) value (readonly)

Returns:



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

def value
  @value
end

Instance Method Details

- (Boolean) ==(other)

Returns:

  • (Boolean)


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

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

- (Boolean) empty?

Returns:

  • (Boolean)


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

def empty?
  false
end

- (String) inspect

Returns:



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

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

- (String) to_s

Returns:



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

def to_s
  ""
end

- (String) to_x12(truncate = true)

Returns:



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

def to_x12(truncate = true)
  ""
end

- (Boolean) valid?

Returns:

  • (Boolean)


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

def valid?
  false
end