Class: ActionSet::SortInstructions

Inherits:
Object
  • Object
show all
Defined in:
lib/action_set/sort_instructions.rb

Instance Method Summary collapse

Constructor Details

#initialize(params, set, controller) ⇒ SortInstructions

Returns a new instance of SortInstructions.



5
6
7
8
9
# File 'lib/action_set/sort_instructions.rb', line 5

def initialize(params, set, controller)
  @params = params
  @set = set
  @controller = controller
end

Instance Method Details

#getObject



11
12
13
14
15
16
17
18
19
20
21
# File 'lib/action_set/sort_instructions.rb', line 11

def get
  instructions_hash = if form_friendly_complex_params?
                        form_friendly_complex_params_to_hash
                      elsif form_friendly_simple_params?
                        form_friendly_simple_params_to_hash
                      else
                        @params
                      end

  instructions_hash.transform_values { |v| v.remove('ending') }
end