Class: Backgrounded::Proxy
- Inherits:
-
Object
- Object
- Backgrounded::Proxy
- Defined in:
- lib/backgrounded/proxy.rb
Instance Attribute Summary collapse
-
#delegate ⇒ Object
readonly
Returns the value of attribute delegate.
-
#options ⇒ Object
readonly
Returns the value of attribute options.
Instance Method Summary collapse
-
#initialize(delegate, options = {}) ⇒ Proxy
constructor
A new instance of Proxy.
- #method_missing(method_name, *args) ⇒ Object
Constructor Details
#initialize(delegate, options = {}) ⇒ Proxy
Returns a new instance of Proxy.
4 5 6 7 |
# File 'lib/backgrounded/proxy.rb', line 4 def initialize(delegate, ={}) @delegate = delegate @options = || {} end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(method_name, *args) ⇒ Object
9 10 11 12 13 |
# File 'lib/backgrounded/proxy.rb', line 9 def method_missing(method_name, *args) Backgrounded.logger.debug("Requesting #{Backgrounded.handler} backgrounded method: #{method_name} for instance #{delegate} with options: #{}") Backgrounded.handler.request(delegate, method_name, args, ) nil end |
Instance Attribute Details
#delegate ⇒ Object (readonly)
Returns the value of attribute delegate.
3 4 5 |
# File 'lib/backgrounded/proxy.rb', line 3 def delegate @delegate end |
#options ⇒ Object (readonly)
Returns the value of attribute options.
3 4 5 |
# File 'lib/backgrounded/proxy.rb', line 3 def @options end |