class LUSI::API::ServiceMethod
Attributes
@!attribute [rw] endpoint
@return [String] the endpoint component of the web service address (e.g. 'General.asmx')
@!attribute [rw] method_name
@return [String] the method name of the web service (e.g. 'GetServiceAccountDetails')
@!attribute [rw] url
@return [String] the web service URL root, excluding the endpoint and method name
@!attribute [rw] web_service
@return [String] the web service name
Public Class Methods
Initialize a new ServiceMethod
instance Fields are extracted from the parsed XML from the LUSI
API
response. A single <ServiceMethod> element is expected. Default values for fields missing from the XML can be specified as keyword arguments. @param xml [Nokogiri::XML::Node, Nokogiri:nil] the XML response from the LUSI
GetServiceAccountDetails API
call, or nil @param lookup [LUSI::API::Core::Lookup::LookupService, nil] the lookup service for object resolution @param web_service
[String, nil] the default web service name @param url [Stirng, nil] the default URL @param endpoint [String, nil] the default endpoint name @param method_name
[String, nil] the default method name
# File lib/lusi_api/service_method.rb, line 35 def initialize(xml = nil, lookup = nil, web_service: nil, url: nil, endpoint: nil, method_name: nil) @web_service = LUSI::API::Core::XML.xml_content_at(xml, 'xmlns:WebService', web_service) @url = LUSI::API::Core::XML.xml_content_at(xml, 'xmlns:Url', url) @endpoint = LUSI::API::Core::XML.xml_content_at(xml, 'xmlns:EndPoint', endpoint) @method_name = LUSI::API::Core::XML.xml_content_at(xml, 'xmlns:MethodName', method_name) end
Public Instance Methods
Return a string representation of the ServiceMethod
instance (the full URL path) @return [String] the string representation of the ServiceMethod
instance
# File lib/lusi_api/service_method.rb, line 44 def to_s "#{@url}/#{@endpoint}/#{@method_name}" end