Class: ONIX::Identifier

Inherits:
SubsetDSL show all
Defined in:
lib/onix/identifier.rb

Instance Attribute Summary

Attributes included from Attributes

#attributes

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from SubsetDSL

element, elements, #get_class, get_class, inherited, #initialize, n, #parse, ref_to_short, register_elements, register_scopes, #register_subset_array, registered_elements, #registered_elements, registered_scopes, scope, short_to_ref

Methods inherited from Subset

parse, #parse, #tag_match, #unsupported

Methods included from Attributes

attribute_class, #parse_attributes, #serialized_attributes

Constructor Details

This class inherits a constructor from ONIX::SubsetDSL

Class Method Details

.identifier_elements(id_type) ⇒ Object



4
5
6
7
8
# File 'lib/onix/identifier.rb', line 4

def identifier_elements(id_type)
  element id_type, :subset, :shortcut => :type, :cardinality => 1
  element "IDTypeName", :text, :shortcut => :name, :cardinality => 0..1
  element "IDValue", :text, :shortcut => :value, :cardinality => 1
end

Instance Method Details

#uniq_idObject



11
12
13
# File 'lib/onix/identifier.rb', line 11

def uniq_id
  "#{type.code}-#{value}"
end