Class: Grape::Formatter::Paginater::BasePage

Inherits:
Object
  • Object
show all
Defined in:
lib/paginater/page/base_page.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize {|_self| ... } ⇒ BasePage

Returns a new instance of BasePage.

Yields:

  • (_self)

Yield Parameters:



11
12
13
# File 'lib/paginater/page/base_page.rb', line 11

def initialize
  yield self if block_given?
end

Instance Attribute Details

#code(&block) ⇒ Object

Returns the value of attribute code.



9
10
11
# File 'lib/paginater/page/base_page.rb', line 9

def code
  @code
end

#contentObject

Returns the value of attribute content.



8
9
10
# File 'lib/paginater/page/base_page.rb', line 8

def content
  @content
end

Returns the value of attribute links.



10
11
12
# File 'lib/paginater/page/base_page.rb', line 10

def links
  @links
end

#next_pageObject

Returns the value of attribute next_page.



8
9
10
# File 'lib/paginater/page/base_page.rb', line 8

def next_page
  @next_page
end

#pageObject

Returns the value of attribute page.



8
9
10
# File 'lib/paginater/page/base_page.rb', line 8

def page
  @page
end

#prev_pageObject

Returns the value of attribute prev_page.



8
9
10
# File 'lib/paginater/page/base_page.rb', line 8

def prev_page
  @prev_page
end

#sizeObject

Returns the value of attribute size.



8
9
10
# File 'lib/paginater/page/base_page.rb', line 8

def size
  @size
end

Instance Method Details

#countObject



21
22
23
# File 'lib/paginater/page/base_page.rb', line 21

def count
  @content.count ||= 1
end

#renderObject

TODO: implement me…



25
26
27
# File 'lib/paginater/page/base_page.rb', line 25

def render
  @code.call self
end