Class: Stupidedi::Versions::Common::ElementTypes::Nn
- Inherits:
-
SimpleElementDef
- Object
- Schema::AbstractDef
- Schema::AbstractElementDef
- Schema::SimpleElementDef
- SimpleElementDef
- Stupidedi::Versions::Common::ElementTypes::Nn
- Defined in:
- lib/stupidedi/versions/common/element_types/nn.rb
Instance Attribute Summary collapse
- #precision ⇒ Integer readonly
Attributes inherited from SimpleElementDef
#description, #id, #max_length, #min_length, #name, #parent
Attributes inherited from Schema::AbstractElementDef
Instance Method Summary collapse
- #companion
- #copy(changes = {}) ⇒ Nn
-
#initialize(id, name, min_length, max_length, precision, description = nil, parent = nil) ⇒ Nn
constructor
A new instance of Nn.
Methods inherited from SimpleElementDef
Methods inherited from Schema::SimpleElementDef
#code_lists, #component_use, #composite?, #empty, #parent, #parse, #simple?, #simple_use, #value
Methods inherited from Schema::AbstractElementDef
#code_lists, #composite?, #descriptor, #element?, #simple?
Methods included from Inspect
Methods inherited from Schema::AbstractDef
#component?, #composite?, #definition?, #descriptor, #element?, #functional_group?, #interchange?, #loop?, #repeated?, #required?, #segment?, #simple?, #table?, #transaction_set?, #usage?
Constructor Details
#initialize(id, name, min_length, max_length, precision, description = nil, parent = nil) ⇒ Nn
Returns a new instance of Nn.
12 13 14 15 16 17 18 19 20 21 |
# File 'lib/stupidedi/versions/common/element_types/nn.rb', line 12 def initialize(id, name, min_length, max_length, precision, description = nil, parent = nil) super(id, name, min_length, max_length, description, parent) if precision > max_length raise Exceptions::InvalidSchemaError, "precision cannot be greater than max_length" end @precision = precision end |
Instance Attribute Details
#precision ⇒ Integer (readonly)
10 11 12 |
# File 'lib/stupidedi/versions/common/element_types/nn.rb', line 10 def precision @precision end |
Instance Method Details
#companion
35 36 37 |
# File 'lib/stupidedi/versions/common/element_types/nn.rb', line 35 def companion FixnumVal end |
#copy(changes = {}) ⇒ Nn
24 25 26 27 28 29 30 31 32 33 |
# File 'lib/stupidedi/versions/common/element_types/nn.rb', line 24 def copy(changes = {}) Nn.new \ changes.fetch(:id, @id), changes.fetch(:name, @name), changes.fetch(:min_length, @min_length), changes.fetch(:max_length, @max_length), changes.fetch(:precision, @precision), changes.fetch(:description, @description), changes.fetch(:parent, @parent) end |