Class: Stupidedi::Versions::FunctionalGroups::FortyTen::ElementTypes::DT

Inherits:
SimpleElementDef show all
Defined in:
lib/stupidedi/versions/functional_groups/004010/element_types/date_val.rb

Overview

Simple element definition for date elements

See Also:

Instance Attribute Summary

Attributes inherited from SimpleElementDef

#description, #id, #max_length, #min_length, #name, #parent

Attributes inherited from Schema::AbstractElementDef

#description, #id, #name

Instance Method Summary collapse

Methods inherited from SimpleElementDef

#copy, #empty, #parse, #pretty_print, #value

Methods inherited from Schema::SimpleElementDef

#code_lists, #component_use, #composite?, #empty, #parent, #parse, #simple?, #simple_use, #value

Methods inherited from Schema::AbstractElementDef

#code_lists, #element?

Methods included from Inspect

#inspect

Methods inherited from Schema::AbstractDef

#component?, #composite?, #definition?, #element?, #functional_group?, #interchange?, #loop?, #repeated?, #segment?, #simple?, #table?, #transaction_set?, #usage?

Constructor Details

#initialize(id, name, min_length, max_length, description = nil, parent = nil) ⇒ DT



14
15
16
17
18
19
20
21
22
23
24
25
26
# File 'lib/stupidedi/versions/functional_groups/004010/element_types/date_val.rb', line 14

def initialize(id, name, min_length, max_length, description = nil, parent = nil)
  super(id, name, min_length, max_length, description, parent)

  unless min_length == 6 or min_length == 8
    raise ArgumentError,
      "min_length must be either 6 or 8"
  end

  unless max_length == 6 or max_length == 8
    raise ArgumentError,
      "max_length must be either 6 or 8"
  end
end

Instance Method Details

#companion



28
29
30
# File 'lib/stupidedi/versions/functional_groups/004010/element_types/date_val.rb', line 28

def companion
  DateVal
end