Module: ProxyMethod
- Defined in:
- lib/proxy_method.rb,
lib/proxy_method/version.rb
Defined Under Namespace
Modules: ClassMethods
Constant Summary collapse
- VERSION =
'1.2.5'
Class Method Summary collapse
Instance Method Summary collapse
-
#proxied ⇒ Object
Return a proxied version of this instance.
-
#unproxied ⇒ Object
Return an unproxied version of this instance.
Class Method Details
.included(base) ⇒ Object
193 194 195 |
# File 'lib/proxy_method.rb', line 193 def self.included(base) base.extend ClassMethods end |
Instance Method Details
#proxied ⇒ Object
Return a proxied version of this instance.
If the instance has previously been “unproxied”, this returns a copy where all proxies are re-enabled.
214 215 216 |
# File 'lib/proxy_method.rb', line 214 def proxied self.dup.send(:reproxy!) end |
#unproxied ⇒ Object
Return an unproxied version of this instance.
This returns a copy of the instance where all proxies are disabled. This is sometimes necessary when a proxied method is being called by a different method outside your control.
204 205 206 |
# File 'lib/proxy_method.rb', line 204 def unproxied self.dup.send(:unproxy!) end |