Class: Stupidedi::Versions::Common::ElementTypes::ID
- Inherits:
-
SimpleElementDef
- Object
- Schema::AbstractDef
- Schema::AbstractElementDef
- Schema::SimpleElementDef
- SimpleElementDef
- Stupidedi::Versions::Common::ElementTypes::ID
- Defined in:
- lib/stupidedi/versions/common/element_types/id.rb
Instance Attribute Summary collapse
- #code_list ⇒ Schema::CodeList readonly
Attributes inherited from SimpleElementDef
#description, #id, #max_length, #min_length, #name, #parent
Attributes inherited from Schema::AbstractElementDef
Instance Method Summary collapse
- #companion
- #component_use(requirement, parent = nil) ⇒ ComponentElementUse
- #copy(changes = {}) ⇒ ID
-
#initialize(id, name, min_length, max_length, code_list = nil, description = nil, parent = nil) ⇒ ID
constructor
A new instance of ID.
- #simple_use(requirement, repeat_count, parent = nil) ⇒ SimpleElementUse
Methods inherited from SimpleElementDef
Methods inherited from Schema::SimpleElementDef
#code_lists, #composite?, #empty, #parent, #parse, #simple?, #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, code_list = nil, description = nil, parent = nil) ⇒ ID
Returns a new instance of ID.
12 13 14 15 |
# File 'lib/stupidedi/versions/common/element_types/id.rb', line 12 def initialize(id, name, min_length, max_length, code_list = nil, description = nil, parent = nil) super(id, name, min_length, max_length, description, parent) @code_list = code_list end |
Instance Attribute Details
#code_list ⇒ Schema::CodeList (readonly)
10 11 12 |
# File 'lib/stupidedi/versions/common/element_types/id.rb', line 10 def code_list @code_list end |
Instance Method Details
#companion
17 18 19 |
# File 'lib/stupidedi/versions/common/element_types/id.rb', line 17 def companion IdentifierVal end |
#component_use(requirement, parent = nil) ⇒ ComponentElementUse
43 44 45 46 47 48 49 |
# File 'lib/stupidedi/versions/common/element_types/id.rb', line 43 def component_use(requirement, parent = nil) if @code_list.try(:internal?) Schema::ComponentElementUse.new(self, requirement, Sets.absolute(@code_list.codes), parent) else Schema::ComponentElementUse.new(self, requirement, Sets.universal, parent) end end |
#copy(changes = {}) ⇒ ID
22 23 24 25 26 27 28 29 30 31 |
# File 'lib/stupidedi/versions/common/element_types/id.rb', line 22 def copy(changes = {}) ID.new \ changes.fetch(:id, @id), changes.fetch(:name, @name), changes.fetch(:min_length, @min_length), changes.fetch(:max_length, @max_length), changes.fetch(:code_list, @code_list), changes.fetch(:description, @description), changes.fetch(:parent, @parent) end |
#simple_use(requirement, repeat_count, parent = nil) ⇒ SimpleElementUse
34 35 36 37 38 39 40 |
# File 'lib/stupidedi/versions/common/element_types/id.rb', line 34 def simple_use(requirement, repeat_count, parent = nil) if @code_list.try(:internal?) Schema::SimpleElementUse.new(self, requirement, repeat_count, Sets.absolute(@code_list.codes), parent) else Schema::SimpleElementUse.new(self, requirement, repeat_count, Sets.universal, parent) end end |