Class: RailsPaginate::Pagers::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/rails_paginate/pagers/base.rb

Overview

base method

Direct Known Subclasses

Slider

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(collection, options = {}) ⇒ Base

set default collection and options



8
9
10
11
# File 'lib/rails_paginate/pagers/base.rb', line 8

def initialize(collection, options = {})
  @collection = collection
  @options = options
end

Instance Attribute Details

#collectionObject (readonly)

default reader



5
6
7
# File 'lib/rails_paginate/pagers/base.rb', line 5

def collection
  @collection
end

#optionsObject (readonly)

default reader



5
6
7
# File 'lib/rails_paginate/pagers/base.rb', line 5

def options
  @options
end

Instance Method Details

#current_pageObject

current_page



14
15
16
# File 'lib/rails_paginate/pagers/base.rb', line 14

def current_page
  collection.current_page
end

#pagesObject

total count



19
20
21
# File 'lib/rails_paginate/pagers/base.rb', line 19

def pages
  collection.pages
end

#visible_pagesObject

abstract

Raises:

  • (StandardError)


24
25
26
# File 'lib/rails_paginate/pagers/base.rb', line 24

def visible_pages
  raise StandardError, "render is not implemented"
end