Class: Hyperion::Riak::OptimizedFilterOrder
- Inherits:
-
Object
- Object
- Hyperion::Riak::OptimizedFilterOrder
- Defined in:
- lib/hyperion/riak/optimized_filter_order.rb
Instance Method Summary collapse
- #filters ⇒ Object
-
#initialize(filters, bucket_name) ⇒ OptimizedFilterOrder
constructor
A new instance of OptimizedFilterOrder.
- #optimal_index_field ⇒ Object
- #optimal_index_value ⇒ Object
- #optimal_strategy ⇒ Object
Constructor Details
#initialize(filters, bucket_name) ⇒ OptimizedFilterOrder
Returns a new instance of OptimizedFilterOrder.
7 8 9 10 |
# File 'lib/hyperion/riak/optimized_filter_order.rb', line 7 def initialize(filters, bucket_name) @bucket_name = bucket_name @filters = filters end |
Instance Method Details
#filters ⇒ Object
28 29 30 |
# File 'lib/hyperion/riak/optimized_filter_order.rb', line 28 def filters optimal_strategy.filters end |
#optimal_index_field ⇒ Object
20 21 22 |
# File 'lib/hyperion/riak/optimized_filter_order.rb', line 20 def optimal_index_field optimal_strategy.optimal_index_field end |
#optimal_index_value ⇒ Object
24 25 26 |
# File 'lib/hyperion/riak/optimized_filter_order.rb', line 24 def optimal_index_value optimal_strategy.optimal_index_value end |
#optimal_strategy ⇒ Object
12 13 14 15 16 17 18 |
# File 'lib/hyperion/riak/optimized_filter_order.rb', line 12 def optimal_strategy @optimal_strategy ||= OPTIMAL_ORDER.map do |strategy_klass| strategy_klass.new(@filters, @bucket_name) end.find do |strategy| strategy.can_optimize? end end |