Class: ActiveRecord::QueryMethods::WhereIs
- Inherits:
-
Object
- Object
- ActiveRecord::QueryMethods::WhereIs
- Defined in:
- lib/where-is-rails/where-is-rails.rb
Instance Attribute Summary collapse
-
#result ⇒ Object
Returns the value of attribute result.
Instance Method Summary collapse
-
#initialize(arel, &block) ⇒ WhereIs
constructor
A new instance of WhereIs.
- #method_missing(method_name, _params = {}) ⇒ Object
Constructor Details
#initialize(arel, &block) ⇒ WhereIs
Returns a new instance of WhereIs.
63 64 65 66 |
# File 'lib/where-is-rails/where-is-rails.rb', line 63 def initialize(arel, &block) @arel = arel self.result = instance_exec(&block) end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(method_name, _params = {}) ⇒ Object
68 69 70 |
# File 'lib/where-is-rails/where-is-rails.rb', line 68 def method_missing(method_name, _params = {}) WhereIsArel.new @arel[method_name] end |
Instance Attribute Details
#result ⇒ Object
Returns the value of attribute result.
61 62 63 |
# File 'lib/where-is-rails/where-is-rails.rb', line 61 def result @result end |