Class: Fugle::HTTP::Client Private
- Inherits:
-
Object
- Object
- Fugle::HTTP::Client
- Defined in:
- lib/fugle/http/client.rb
Overview
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
The Fugle HTTP Client
Instance Method Summary collapse
-
#initialize ⇒ Client
constructor
private
A new instance of Client.
- #method_missing(name, *args) {|res.body| ... } ⇒ Object private
- #respond_to_missing?(_name) ⇒ Boolean private
Constructor Details
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(name, *args) {|res.body| ... } ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
28 29 30 31 32 33 34 35 36 |
# File 'lib/fugle/http/client.rb', line 28 def method_missing(name, *args, &block) @api = find(name) return super if @api.nil? return self unless @api.is_a?(Class) res = fetch(@api.uri(*args)) yield res.body if block_given? res end |
Instance Method Details
#respond_to_missing?(_name) ⇒ Boolean
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
22 23 24 |
# File 'lib/fugle/http/client.rb', line 22 def respond_to_missing?(_name) super end |