Class: Stupidedi::Versions::Common::ElementTypes::TimeVal::Empty

Inherits:
Valid show all
Defined in:
lib/stupidedi/versions/common/element_types/tm.rb

Instance Attribute Summary

Attributes inherited from Stupidedi::Values::SimpleElementVal

#position, #usage

Instance Method Summary collapse

Methods inherited from Valid

#==, #coerce, #copy, #map, #valid?

Methods inherited from Stupidedi::Versions::Common::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?, #too_long?, #too_short?, #valid?

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?, #valid?

Methods included from Color

ansi, #ansi

Constructor Details

This class inherits a constructor from Stupidedi::Values::SimpleElementVal

Instance Method Details

#empty?Boolean

Returns:

  • (Boolean)

138
139
140
# File 'lib/stupidedi/versions/common/element_types/tm.rb', line 138

def empty?
  true
end

#inspectString

:nocov:

Returns:

  • (String)

144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
# File 'lib/stupidedi/versions/common/element_types/tm.rb', line 144

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)

162
163
164
# File 'lib/stupidedi/versions/common/element_types/tm.rb', line 162

def to_s
  ""
end

#to_x12(truncate = true) ⇒ String

Returns:

  • (String)

167
168
169
# File 'lib/stupidedi/versions/common/element_types/tm.rb', line 167

def to_x12(truncate = true)
  ""
end

#value


134
135
136
# File 'lib/stupidedi/versions/common/element_types/tm.rb', line 134

def value
  nil
end