Class: Pagoid::PagingAdapter

Inherits:
SimpleDelegator
  • Object
show all
Defined in:
lib/pagoid/paging_adapter.rb

Direct Known Subclasses

Kaminari, WillPaginate

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(paginatable, attributes = {}) ⇒ PagingAdapter

Returns a new instance of PagingAdapter.



7
8
9
10
11
# File 'lib/pagoid/paging_adapter.rb', line 7

def initialize(paginatable, attributes = {})
  self.paginatable = paginatable
  self.attributes = attributes
  super coerce
end

Instance Attribute Details

#attributesObject

Returns the value of attribute attributes.



5
6
7
# File 'lib/pagoid/paging_adapter.rb', line 5

def attributes
  @attributes
end

#paginatableObject

Returns the value of attribute paginatable.



4
5
6
# File 'lib/pagoid/paging_adapter.rb', line 4

def paginatable
  @paginatable
end

Instance Method Details

#chain(object, state = {}) ⇒ Object



23
24
25
# File 'lib/pagoid/paging_adapter.rb', line 23

def chain(object, state = {})
  self.class.new object, state
end

#coerce(coerceable = paginatable) ⇒ Object



13
14
15
# File 'lib/pagoid/paging_adapter.rb', line 13

def coerce(coerceable = paginatable)
  coerceable
end