Class: LUSI::API::ServiceMethod
- Inherits:
-
Object
- Object
- LUSI::API::ServiceMethod
- Defined in:
- lib/lusi_api/service_method.rb
Overview
Represents a LUSI API service method
Instance Attribute Summary collapse
-
#endpoint ⇒ String
The endpoint component of the web service address (e.g. ‘General.asmx’).
-
#method_name ⇒ String
The method name of the web service (e.g. ‘GetServiceAccountDetails’).
-
#url ⇒ String
The web service URL root, excluding the endpoint and method name.
-
#web_service ⇒ String
The web service name.
Instance Method Summary collapse
-
#initialize(xml = nil, lookup = nil, web_service: nil, url: nil, endpoint: nil, method_name: nil) ⇒ ServiceMethod
constructor
Initialize a new ServiceMethod instance Fields are extracted from the parsed XML from the LUSI API response.
-
#to_s ⇒ String
Return a string representation of the ServiceMethod instance (the full URL path).
Constructor Details
#initialize(xml = nil, lookup = nil, web_service: nil, url: nil, endpoint: nil, method_name: nil) ⇒ ServiceMethod
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.
35 36 37 38 39 40 |
# 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 |
Instance Attribute Details
#endpoint ⇒ String
Returns the endpoint component of the web service address (e.g. ‘General.asmx’).
12 13 14 |
# File 'lib/lusi_api/service_method.rb', line 12 def endpoint @endpoint end |
#method_name ⇒ String
Returns the method name of the web service (e.g. ‘GetServiceAccountDetails’).
16 17 18 |
# File 'lib/lusi_api/service_method.rb', line 16 def method_name @method_name end |
#url ⇒ String
Returns the web service URL root, excluding the endpoint and method name.
20 21 22 |
# File 'lib/lusi_api/service_method.rb', line 20 def url @url end |
#web_service ⇒ String
Returns the web service name.
24 25 26 |
# File 'lib/lusi_api/service_method.rb', line 24 def web_service @web_service end |
Instance Method Details
#to_s ⇒ String
Return a string representation of the ServiceMethod instance (the full URL path)
44 45 46 |
# File 'lib/lusi_api/service_method.rb', line 44 def to_s "#{@url}/#{@endpoint}/#{@method_name}" end |