Class: ArelOperators::Finder
- Inherits:
-
Object
- Object
- ArelOperators::Finder
- Defined in:
- lib/arel_operators/finder.rb,
lib/arel_operators/finder/comparators.rb
Defined Under Namespace
Classes: Comparators
Instance Attribute Summary collapse
-
#arel ⇒ Object
readonly
Returns the value of attribute arel.
-
#table ⇒ Object
readonly
Returns the value of attribute table.
Instance Method Summary collapse
- #&(other) ⇒ Object
- #-@ ⇒ Object
-
#initialize(arel_table, operation = nil) ⇒ Finder
constructor
A new instance of Finder.
- #|(other) ⇒ Object
Constructor Details
#initialize(arel_table, operation = nil) ⇒ Finder
Returns a new instance of Finder.
6 7 8 9 10 |
# File 'lib/arel_operators/finder.rb', line 6 def initialize(arel_table, operation=nil) @table = arel_table @arel = operation @table.attributes.each { |a| define_attribute_method a.name } end |
Instance Attribute Details
#arel ⇒ Object (readonly)
Returns the value of attribute arel.
4 5 6 |
# File 'lib/arel_operators/finder.rb', line 4 def arel @arel end |
#table ⇒ Object (readonly)
Returns the value of attribute table.
4 5 6 |
# File 'lib/arel_operators/finder.rb', line 4 def table @table end |
Instance Method Details
#&(other) ⇒ Object
24 25 26 27 |
# File 'lib/arel_operators/finder.rb', line 24 def &(other) other = other.arel if other.respond_to?(:arel) Finder.new(table, arel.and(other)) end |