Module: IndexView::CustomizationDefaults

Included in:
Base
Defined in:
lib/index_view/customization_defaults.rb

Overview

The following methods are safe to override in descendent classes

Constant Summary collapse

DEFAULT_PAGINATION_NUMBER =
30

Instance Method Summary collapse

Instance Method Details

#default_sort_directionObject



24
25
26
# File 'lib/index_view/customization_defaults.rb', line 24

def default_sort_direction
  Implementation::DESC
end

#default_sort_termObject

Raises:

  • (NotImplementedError)


16
17
18
# File 'lib/index_view/customization_defaults.rb', line 16

def default_sort_term
  raise NotImplementedError, "default_sort_term must be defined"
end

#per_pageObject



10
11
12
13
14
# File 'lib/index_view/customization_defaults.rb', line 10

def per_page
  target_class.respond_to?(:per_page) ?
    target_class.per_page :
    DEFAULT_PAGINATION_NUMBER
end

#secondary_sort_termObject



20
21
22
# File 'lib/index_view/customization_defaults.rb', line 20

def secondary_sort_term
  nil
end

#target_classObject

Raises:

  • (NotImplementedError)


6
7
8
# File 'lib/index_view/customization_defaults.rb', line 6

def target_class
  raise NotImplementedError
end