Class: LUSI::API::Core::Code

Inherits:
BasicCode show all
Defined in:
lib/lusi_api/core/code.rb

Overview

Represents a LUSI code definition which can be retrieved through the LUSI API

Instance Attribute Summary

Attributes inherited from BasicCode

#description, #identity

Class Method Summary collapse

Methods inherited from BasicCode

#initialize, #to_s

Constructor Details

This class inherits a constructor from LUSI::API::Core::BasicCode

Class Method Details

.get_instance(api = nil, lookup = nil, path = nil, endpoint = nil, method = nil, xml_root = nil, **kwargs) {|obj| ... } ⇒ Array<LUSI::API::Core::Code>

Returns a Code instance for the specifiec LUSI API call

Yields:

  • (obj)

    Passes the Code instance to the block

Yield Parameters:



69
70
71
72
73
74
75
76
77
78
79
80
81
# File 'lib/lusi_api/core/code.rb', line 69

def self.get_instance(api = nil, lookup = nil, path = nil, endpoint = nil, method = nil, xml_root = nil, **kwargs)
  params = get_instance_params(**kwargs)
  xml = api.call(path, endpoint, method, **params)
  LUSI::API::Core::XML.xml(xml, xml_root) do |c|
    obj = new(c, lookup)
    begin
      yield(obj) if block_given?
    rescue StandardError => e
      puts e
    end
    obj
  end
end