Class: ChaoticOrder::Manager

Inherits:
Object
  • Object
show all
Defined in:
lib/chaotic_order/manager.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(arel, adapter_name) ⇒ Manager

Returns a new instance of Manager.



7
8
9
10
# File 'lib/chaotic_order/manager.rb', line 7

def initialize(arel, adapter_name)
  @arel = arel
  @adapter_name = adapter_name
end

Instance Attribute Details

#adapter_nameObject (readonly)

Returns the value of attribute adapter_name.



5
6
7
# File 'lib/chaotic_order/manager.rb', line 5

def adapter_name
  @adapter_name
end

#arelObject (readonly)

Returns the value of attribute arel.



5
6
7
# File 'lib/chaotic_order/manager.rb', line 5

def arel
  @arel
end

Instance Method Details

#set_random_orderObject



12
13
14
15
16
# File 'lib/chaotic_order/manager.rb', line 12

def set_random_order
  return unless set_random_order?

  arel.order(random_for_adapter)
end