Class: Workarea::Listrak::BogusDataApi::ProxyClient
- Inherits:
-
Object
- Object
- Workarea::Listrak::BogusDataApi::ProxyClient
- Defined in:
- lib/workarea/listrak/bogus_data_api/proxy_client.rb
Instance Attribute Summary collapse
-
#client ⇒ Object
readonly
Returns the value of attribute client.
-
#client_name ⇒ Object
readonly
Returns the value of attribute client_name.
Instance Method Summary collapse
-
#initialize(client_name, client) ⇒ ProxyClient
constructor
A new instance of ProxyClient.
- #method_missing(method, *args) ⇒ Object
- #respond_to_missing?(method, include_all = false) ⇒ Boolean
Constructor Details
#initialize(client_name, client) ⇒ ProxyClient
Returns a new instance of ProxyClient.
7 8 9 10 |
# File 'lib/workarea/listrak/bogus_data_api/proxy_client.rb', line 7 def initialize(client_name, client) @client_name = client_name @client = client end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(method, *args) ⇒ Object
12 13 14 15 16 17 18 19 20 21 |
# File 'lib/workarea/listrak/bogus_data_api/proxy_client.rb', line 12 def method_missing(method, *args) if client.respond_to?(method) if BogusDataApi.store_requests BogusDataApi.requests[client_name][method] << args end client.send(method, *args) else super end end |
Instance Attribute Details
#client ⇒ Object (readonly)
Returns the value of attribute client.
5 6 7 |
# File 'lib/workarea/listrak/bogus_data_api/proxy_client.rb', line 5 def client @client end |
#client_name ⇒ Object (readonly)
Returns the value of attribute client_name.
5 6 7 |
# File 'lib/workarea/listrak/bogus_data_api/proxy_client.rb', line 5 def client_name @client_name end |
Instance Method Details
#respond_to_missing?(method, include_all = false) ⇒ Boolean
23 24 25 |
# File 'lib/workarea/listrak/bogus_data_api/proxy_client.rb', line 23 def respond_to_missing?(method, include_all = false) client.respond_to?(method) || super end |