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.
610 611 612 |
# File 'lib/simple_drilldown/controller.rb', line 610 def initialize(scope) instance_eval(&scope) end |
Instance Method Details
#order(order) ⇒ Object
614 615 616 617 |
# File 'lib/simple_drilldown/controller.rb', line 614 def order(order) @order = order self end |
#to_s ⇒ Object
623 624 625 626 627 628 629 |
# File 'lib/simple_drilldown/controller.rb', line 623 def to_s if @order.is_a?(Hash) @order.map { |field, direction| "#{field} #{direction}" }.join(', ') else @order.to_s end end |
#where(*_conditions) ⇒ Object
619 620 621 |
# File 'lib/simple_drilldown/controller.rb', line 619 def where(*_conditions) self end |