Class: Stupidedi::Versions::FunctionalGroups::ThirtyForty::ElementTypes::TimeVal::Empty

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

Overview

Empty time value. Shouldn’t be directly instantiated – instead, use the empty constructor.

Instance Attribute Summary

Attributes inherited from Stupidedi::Values::SimpleElementVal

#position, #usage

Instance Method Summary collapse

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

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


140
141
142
# File 'lib/stupidedi/versions/functional_groups/003040/element_types/time_val.rb', line 140

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

#empty?Boolean

Returns:

  • (Boolean)


108
109
110
# File 'lib/stupidedi/versions/functional_groups/003040/element_types/time_val.rb', line 108

def empty?
  true
end

#inspectString

Returns:

  • (String)


113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
# File 'lib/stupidedi/versions/functional_groups/003040/element_types/time_val.rb', line 113

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.empty#{id}")
end

#to_sString

Returns:

  • (String)


130
131
132
# File 'lib/stupidedi/versions/functional_groups/003040/element_types/time_val.rb', line 130

def to_s
  ""
end

#to_x12(truncate = true) ⇒ String

Returns:

  • (String)


135
136
137
# File 'lib/stupidedi/versions/functional_groups/003040/element_types/time_val.rb', line 135

def to_x12(truncate = true)
  ""
end

#valid?Boolean

Returns:

  • (Boolean)


104
105
106
# File 'lib/stupidedi/versions/functional_groups/003040/element_types/time_val.rb', line 104

def valid?
  true
end