Class: SimpleDrilldown::Controller::ScopeHolder
- Inherits:
-
Object
- Object
- SimpleDrilldown::Controller::ScopeHolder
- Defined in:
- lib/simple_drilldown/controller.rb
Instance Method Summary collapse
-
#initialize(scope) ⇒ ScopeHolder
constructor
A new instance of ScopeHolder.
- #order(order) ⇒ Object
- #to_s ⇒ Object
- #where(*_conditions) ⇒ Object
Constructor Details
#initialize(scope) ⇒ ScopeHolder
Returns a new instance of ScopeHolder.
611 612 613 |
# File 'lib/simple_drilldown/controller.rb', line 611 def initialize(scope) instance_eval(&scope) end |
Instance Method Details
#order(order) ⇒ Object
615 616 617 618 |
# File 'lib/simple_drilldown/controller.rb', line 615 def order(order) @order = order self end |
#to_s ⇒ Object
624 625 626 627 628 629 630 |
# File 'lib/simple_drilldown/controller.rb', line 624 def to_s if @order.is_a?(Hash) @order.map { |field, direction| "#{field} #{direction}" }.join(', ') else @order.to_s end end |
#where(*_conditions) ⇒ Object
620 621 622 |
# File 'lib/simple_drilldown/controller.rb', line 620 def where(*_conditions) self end |