Class: Exlibris::Primo::WebService::Request::Base
- Inherits:
-
Object
- Object
- Exlibris::Primo::WebService::Request::Base
- Includes:
- Abstract, Config::Attributes, Namespaces, Client, BaseElements, Call, SoapAction, Exlibris::Primo::WriteAttributes, XmlUtil
- Defined in:
- lib/exlibris/primo/web_service/request/base.rb
Overview
Abstract base class for Primo interactions
Constant Summary collapse
- DEFAULT_WRAPPER =
:request
Instance Attribute Summary collapse
-
#base_url ⇒ Object
writeonly
Sets the attribute base_url.
-
#institution ⇒ Object
writeonly
Sets the attribute institution.
Instance Method Summary collapse
-
#initialize(*args) ⇒ Base
constructor
A new instance of Base.
- #to_xml(&block) ⇒ Object
Methods included from XmlUtil
Methods included from Exlibris::Primo::WriteAttributes
Methods included from SoapAction
Methods included from Namespaces
Methods included from Config::Attributes
#availability_statuses, #base_url, #config, #facet_collections, #facet_labels, #facet_resource_types, #facet_top_level, #institution, #institutions, #libraries, #sources
Methods included from Call
Methods included from BaseElements
included, #method_missing, #respond_to?
Methods included from Abstract
Constructor Details
#initialize(*args) ⇒ Base
Returns a new instance of Base.
27 28 29 30 31 |
# File 'lib/exlibris/primo/web_service/request/base.rb', line 27 def initialize *args super @root = "#{self.class.name.demodulize}Request".camelize(:lower).to_sym @wrapper = DEFAULT_WRAPPER.id2name.camelize(:lower).to_sym end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class Exlibris::Primo::WebService::Request::BaseElements
Instance Attribute Details
#base_url=(value) ⇒ Object (writeonly)
Sets the attribute base_url
25 26 27 |
# File 'lib/exlibris/primo/web_service/request/base.rb', line 25 def base_url=(value) @base_url = value end |
#institution=(value) ⇒ Object (writeonly)
Sets the attribute institution
25 26 27 |
# File 'lib/exlibris/primo/web_service/request/base.rb', line 25 def institution=(value) @institution = value end |
Instance Method Details
#to_xml(&block) ⇒ Object
33 34 35 36 37 38 39 40 41 42 43 44 45 |
# File 'lib/exlibris/primo/web_service/request/base.rb', line 33 def to_xml &block namespaces = request_namespaces build_xml { |xml| xml.send(wrapper) { xml.cdata build_xml { |xml| xml.send(root, namespaces) { yield xml if block xml << base_elements_xml } } } } end |