Module: Arel::ObjectExtensions
- Defined in:
- lib/arel/algebra/core_extensions/object.rb
Instance Method Summary collapse
- #bind(relation) ⇒ Object
-
#class_eval(*args, &block) ⇒ Object
class_eval on an object acts like singleton_class_eval.
- #find_correlate_in(relation) ⇒ Object
- #let {|_self| ... } ⇒ Object
-
#singleton_class ⇒ Object
TODO remove this when ActiveSupport beta1 is out.
Instance Method Details
#bind(relation) ⇒ Object
3 4 5 |
# File 'lib/arel/algebra/core_extensions/object.rb', line 3 def bind(relation) Arel::Value.new(self, relation) end |
#class_eval(*args, &block) ⇒ Object
class_eval on an object acts like singleton_class_eval.
24 25 26 |
# File 'lib/arel/algebra/core_extensions/object.rb', line 24 def class_eval(*args, &block) singleton_class.class_eval(*args, &block) end |
#find_correlate_in(relation) ⇒ Object
7 8 9 |
# File 'lib/arel/algebra/core_extensions/object.rb', line 7 def find_correlate_in(relation) bind(relation) end |
#let {|_self| ... } ⇒ Object
11 12 13 |
# File 'lib/arel/algebra/core_extensions/object.rb', line 11 def let yield(self) end |
#singleton_class ⇒ Object
TODO remove this when ActiveSupport beta1 is out. Returns the object’s singleton class.
17 18 19 20 21 |
# File 'lib/arel/algebra/core_extensions/object.rb', line 17 def singleton_class class << self self end end |