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.



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

def initialize(scope)
  instance_eval(&scope)
end

Instance Method Details

#order(order) ⇒ Object



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

def order(order)
  @order = order
  self
end

#to_sObject



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

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

#where(*_conditions) ⇒ Object



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

def where(*_conditions)
  self
end