Class: HQMF::Identifier
- Inherits:
-
Object
- Object
- HQMF::Identifier
- Includes:
- Conversion::Utilities
- Defined in:
- lib/hqmf-model/types.rb
Instance Attribute Summary collapse
-
#extension ⇒ Object
Returns the value of attribute extension.
-
#root ⇒ Object
Returns the value of attribute root.
-
#type ⇒ Object
Returns the value of attribute type.
Class Method Summary collapse
Instance Method Summary collapse
- #==(other) ⇒ Object
-
#initialize(type, root, extension = nil) ⇒ Identifier
constructor
A new instance of Identifier.
- #to_json ⇒ Object
Methods included from Conversion::Utilities
#build_hash, #check_equality, #json_array, #openstruct_to_json
Constructor Details
#initialize(type, root, extension = nil) ⇒ Identifier
Returns a new instance of Identifier.
359 360 361 362 363 |
# File 'lib/hqmf-model/types.rb', line 359 def initialize(type, root, extension=nil) @type = type || 'II' @root = root @extension = extension end |
Instance Attribute Details
#extension ⇒ Object
Returns the value of attribute extension.
357 358 359 |
# File 'lib/hqmf-model/types.rb', line 357 def extension @extension end |
#root ⇒ Object
Returns the value of attribute root.
357 358 359 |
# File 'lib/hqmf-model/types.rb', line 357 def root @root end |
#type ⇒ Object
Returns the value of attribute type.
357 358 359 |
# File 'lib/hqmf-model/types.rb', line 357 def type @type end |
Class Method Details
.from_json(json) ⇒ Object
365 366 367 368 |
# File 'lib/hqmf-model/types.rb', line 365 def self.from_json(json) json = json.with_indifferent_access HQMF::Identifier.new(json['type'], json['root'], json['extension']) end |
Instance Method Details
#==(other) ⇒ Object
374 375 376 |
# File 'lib/hqmf-model/types.rb', line 374 def ==(other) check_equality(self,other) end |
#to_json ⇒ Object
370 371 372 |
# File 'lib/hqmf-model/types.rb', line 370 def to_json build_hash(self, [:type, :root, :extension]) end |