Module: OrderTree::ProxyOperator
- Included in:
- OrderTree
- Defined in:
- lib/order_tree/unique_proxy.rb
Overview
Mixin module that provides a proxy convience functions
Class Method Summary collapse
-
.proxy(obj) ⇒ UniqueProxy
Create a unique proxy over obj.
-
.proxy?(obj) ⇒ Boolean
Is object in fact a proxy?.
Class Method Details
.proxy(obj) ⇒ UniqueProxy
Returns create a unique proxy over obj.
17 18 19 20 |
# File 'lib/order_tree/unique_proxy.rb', line 17 def proxy obj UniqueProxy.new obj rescue false end |
.proxy?(obj) ⇒ Boolean
Returns is object in fact a proxy?.
9 10 11 12 |
# File 'lib/order_tree/unique_proxy.rb', line 9 def proxy? obj !!(obj.instance_eval { @is_proxy }) rescue false end |