Class: LUSI::API::Core::BasicCode
- Inherits:
-
Object
- Object
- LUSI::API::Core::BasicCode
- Defined in:
- lib/lusi_api/core/code.rb
Overview
Represents a LUSI code definition (identity code and text description)
Direct Known Subclasses
Instance Attribute Summary collapse
-
#description ⇒ any?
The text description.
-
#identity ⇒ any?
The identity code.
Class Method Summary collapse
-
.get_instance(*args, **kwargs) ⇒ Object
Default get_instance implementation - Instances cannot be retrieved through the LUSI API.
Instance Method Summary collapse
-
#initialize(xml = nil, lookup = nil, identity: nil, description: nil) ⇒ void
constructor
Initialises a new Code instance.
-
#to_s ⇒ String?
Returns a string representation of the code.
Constructor Details
#initialize(xml = nil, lookup = nil, identity: nil, description: nil) ⇒ void
Initialises a new Code instance
26 27 28 29 |
# File 'lib/lusi_api/core/code.rb', line 26 def initialize(xml = nil, lookup = nil, identity: nil, description: nil) @description = LUSI::API::Core::XML.xml_content_at(xml, 'xmlns:Description', description) @identity = LUSI::API::Core::XML.xml_content_at(xml, 'xmlns:Identity', identity) end |
Instance Attribute Details
#description ⇒ any?
Returns the text description.
14 15 16 |
# File 'lib/lusi_api/core/code.rb', line 14 def description @description end |
#identity ⇒ any?
Returns the identity code.
18 19 20 |
# File 'lib/lusi_api/core/code.rb', line 18 def identity @identity end |
Class Method Details
.get_instance(*args, **kwargs) ⇒ Object
Default get_instance implementation
-
Instances cannot be retrieved through the LUSI API
39 40 41 |
# File 'lib/lusi_api/core/code.rb', line 39 def self.get_instance(*args, **kwargs) raise NotImplementedError end |
Instance Method Details
#to_s ⇒ String?
Returns a string representation of the code
33 34 35 |
# File 'lib/lusi_api/core/code.rb', line 33 def to_s @description end |