Class: SimpleDrilldown::DrilldownController::ScopeHolder

Inherits:
Object
  • Object
show all
Defined in:
lib/simple_drilldown/drilldown_controller.rb

Instance Method Summary collapse

Constructor Details

#initialize(scope) ⇒ ScopeHolder

Returns a new instance of ScopeHolder.



549
550
551
# File 'lib/simple_drilldown/drilldown_controller.rb', line 549

def initialize(scope)
  instance_eval(&scope)
end

Instance Method Details

#order(order) ⇒ Object



553
554
555
556
# File 'lib/simple_drilldown/drilldown_controller.rb', line 553

def order(order)
  @order = order
  self
end

#to_sObject



562
563
564
565
566
567
568
# File 'lib/simple_drilldown/drilldown_controller.rb', line 562

def to_s
  if @order.is_a?(Hash)
    @order.map { |field, direction| "#{field} #{direction}" }.join(', ')
  else
    @order.to_s
  end
end

#where(*_conditions) ⇒ Object



558
559
560
# File 'lib/simple_drilldown/drilldown_controller.rb', line 558

def where(*_conditions)
  self
end