Class: Ooor::Service
- Inherits:
-
Object
- Object
- Ooor::Service
- Defined in:
- lib/ooor/services.rb
Direct Known Subclasses
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(session) ⇒ Service
constructor
A new instance of Service.
Constructor Details
#initialize(session) ⇒ Service
Returns a new instance of Service.
12 13 14 |
# File 'lib/ooor/services.rb', line 12 def initialize(session) @session = session end |
Class Method Details
.define_service(service, methods) ⇒ Object
16 17 18 19 20 21 22 23 24 25 |
# File 'lib/ooor/services.rb', line 16 def self.define_service(service, methods) methods.each do |meth| self.instance_eval do define_method meth do |*args| endpoint = @session.get_client(:xml, "#{@session.base_url}/#{service.to_s.gsub('ooor_alias_', '')}") #TODO make that transport agnostic endpoint.call(meth.gsub('ooor_alias_', ''), *args) end end end end |