Class: WEB_API::Auto
Instance Attribute Summary
Attributes inherited from WebApi
Instance Method Summary collapse
-
#initialize(base) ⇒ Auto
constructor
base no longer optional.
- #method_missing(symbol, *args) ⇒ Object
Methods inherited from WebApi
#_add, #_url, #add, trace, trace=
Constructor Details
#initialize(base) ⇒ Auto
base no longer optional
6 7 8 |
# File 'lib/web_api/auto.rb', line 6 def initialize(base) super(base) end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(symbol, *args) ⇒ Object
10 11 12 13 14 15 16 17 |
# File 'lib/web_api/auto.rb', line 10 def method_missing(symbol , *args) if @webmethods.has_key?(symbol) return @webmethods[symbol].call(args) end path = (args.length > 0)? (symbol.to_s + '/' + args.join('/')) : symbol.to_s uri = URI.parse _url(path) WebApiMethod.new(uri, :get).call([]) end |