Class: Stupidedi::Versions::Common::ElementTypes::StringVal::Empty

Inherits:
Valid show all
Defined in:
lib/stupidedi/versions/common/element_types/an.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 included from Operators::Wrappers

#wrappers

Methods included from Operators::Unary

#unary_operators

Methods included from Operators::Relational

#relational_operators

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

empty, #string?, #too_long?, #too_short?, value

Methods inherited from Stupidedi::Values::SimpleElementVal

#allowed?, #component?, #copy, #date?, #id?, #initialize, #leaf?, #numeric?, #simple?, #string?, #time?, #to_s, #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?, #empty?, #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

#inspectString

:nocov:

Returns:

  • (String)

265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
# File 'lib/stupidedi/versions/common/element_types/an.rb', line 265

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

#to_date(format)


287
288
289
# File 'lib/stupidedi/versions/common/element_types/an.rb', line 287

def to_date(format)
  nil
end

#to_x12(truncate = true) ⇒ String

Returns:

  • (String)

283
284
285
# File 'lib/stupidedi/versions/common/element_types/an.rb', line 283

def to_x12(truncate = true)
  ""
end

#valueString

Returns:

  • (String)

259
260
261
# File 'lib/stupidedi/versions/common/element_types/an.rb', line 259

def value
  ""
end