Class: Otis::Client

Inherits:
Object
  • Object
show all
Includes:
Hooks
Defined in:
lib/otis/client.rb

Direct Known Subclasses

HttpClient, SoapClient

Method Summary

Methods included from Hooks

included

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(meth, *args) ⇒ Object (protected)

Tries to find the requested method in the routes map. Send it to Object$method_missing if the desired route is not found



8
9
10
11
12
13
14
15
16
17
# File 'lib/otis/client.rb', line 8

def method_missing(meth, *args)
  klass = @routes[meth.to_sym]
  super unless klass
  if respond_to?("filter_for_#{meth}")
    filter_meth = send("filter_for_#{meth}")
    send(filter_meth, call(meth, *args))
  else
    klass.new(call(meth, *args))
  end
end