Class: SimpleDrilldown::Controller::ScopeHolder

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

Instance Method Summary collapse

Constructor Details

#initialize(scope) ⇒ ScopeHolder

Returns a new instance of ScopeHolder.



618
619
620
# File 'lib/simple_drilldown/controller.rb', line 618

def initialize(scope)
  instance_eval(&scope)
end

Instance Method Details

#order(order) ⇒ Object



622
623
624
625
# File 'lib/simple_drilldown/controller.rb', line 622

def order(order)
  @order = order
  self
end

#to_sObject



631
632
633
634
635
636
637
# File 'lib/simple_drilldown/controller.rb', line 631

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

#where(*_conditions) ⇒ Object



627
628
629
# File 'lib/simple_drilldown/controller.rb', line 627

def where(*_conditions)
  self
end