Class: Stupidedi::Versions::FunctionalGroups::FortyTen::ElementTypes::R

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

Instance Attribute Summary collapse

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, max_precision = nil, description = nil, parent = nil) ⇒ R

Returns a new instance of R.



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

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

  if max_precision.try(:>, max_length)
    raise ArgumentError,
      "max_precision cannot be greater than max_length"
  end

  @max_precision = max_precision
end

Instance Attribute Details

#max_precisionInteger (readonly)

Returns:

  • (Integer)


14
15
16
# File 'lib/stupidedi/versions/functional_groups/004010/element_types/float_val.rb', line 14

def max_precision
  @max_precision
end

Instance Method Details

#companionObject



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

def companion
  FloatVal
end