class LUSI::API::Core::BasicCode

Represents a LUSI code definition (identity code and text description)

Attributes

description[RW]

@!attribute [rw] description

@return [any, nil] the text description
identity[RW]

@!attribute [rw] identity

@return [any, nil] the identity code

Public Class Methods

get_instance(*args, **kwargs) click to toggle source

Default get_instance implementation

  • Instances cannot be retrieved through the LUSI API

# File lib/lusi_api/core/code.rb, line 39
def self.get_instance(*args, **kwargs)
  raise NotImplementedError
end
new(xml = nil, lookup = nil, identity: nil, description: nil) click to toggle source

Initialises a new Code instance @param xml [Nokogiri::XML::Document, Nokogiri::XML::Node] the XML root of the code from the LUSI API @param lookup [LUSI::API::Core::Lookup::LookupService, nil] the lookup service for object resolution @param identity [any, nil] the default identity code @param description [String, nil] the default text description @return [void]

# 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

Protected Class Methods

get_instance_params(*args, **kwargs) click to toggle source

Default get_instance_params implementation

  • Instances cannot be retrieved through the LUSI API

# File lib/lusi_api/core/code.rb, line 47
def self.get_instance_params(*args, **kwargs)
  {}
end

Public Instance Methods

to_s() click to toggle source

Returns a string representation of the code @return [String, nil] the string representation (text description)

# File lib/lusi_api/core/code.rb, line 33
def to_s
  @description
end