Class: LUSI::API::Core::Code
- Defined in:
- lib/lusi_api/core/code.rb
Overview
Represents a LUSI code definition which can be retrieved through the LUSI API
Direct Known Subclasses
LUSI::API::Calendar::Week, LUSI::API::Calendar::Year, LUSI::API::Country::Country, LUSI::API::Course::SyllabusRuleType, Enrolment::EnrolmentRole, Person::StaffCourseRole
Instance Attribute Summary
Attributes inherited from BasicCode
Class Method Summary collapse
-
.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.
Methods inherited from BasicCode
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
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 |