Class: Remotable::WithRemoteModelProxy
- Inherits:
-
Object
- Object
- Remotable::WithRemoteModelProxy
- Defined in:
- lib/remotable/with_remote_model_proxy.rb
Instance Method Summary collapse
-
#initialize(model, remote_model) ⇒ WithRemoteModelProxy
constructor
A new instance of WithRemoteModelProxy.
- #method_missing(sym, *args, &block) ⇒ Object
Constructor Details
#initialize(model, remote_model) ⇒ WithRemoteModelProxy
Returns a new instance of WithRemoteModelProxy.
4 5 6 7 |
# File 'lib/remotable/with_remote_model_proxy.rb', line 4 def initialize(model, remote_model) @model = model @remote_model = remote_model end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(sym, *args, &block) ⇒ Object
11 12 13 14 15 |
# File 'lib/remotable/with_remote_model_proxy.rb', line 11 def method_missing(sym, *args, &block) @model.with_remote_model(@remote_model) do @model.send(sym, *args, &block) end end |