Class: ActiveRecord::Base::Replica::Proxy
- Inherits:
-
Object
- Object
- ActiveRecord::Base::Replica::Proxy
- Defined in:
- lib/replica/base.rb
Instance Method Summary collapse
-
#initialize(target, replica) ⇒ Proxy
constructor
A new instance of Proxy.
- #method_missing(method, *args, &block) ⇒ Object
Constructor Details
#initialize(target, replica) ⇒ Proxy
Returns a new instance of Proxy.
109 110 111 112 |
# File 'lib/replica/base.rb', line 109 def initialize(target, replica) @target = target @replica = replica end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(method, *args, &block) ⇒ Object
114 115 116 |
# File 'lib/replica/base.rb', line 114 def method_missing(method, *args, &block) @target.with_replica_block(@replica) { @target.send(method, *args, &block) } end |