Class: Grape::Formatter::Paginater::BasePage
- Inherits:
-
Object
- Object
- Grape::Formatter::Paginater::BasePage
- Defined in:
- lib/paginater/page/base_page.rb
Instance Attribute Summary collapse
-
#code(&block) ⇒ Object
Returns the value of attribute code.
-
#content ⇒ Object
Returns the value of attribute content.
-
#links ⇒ Object
Returns the value of attribute links.
-
#next_page ⇒ Object
Returns the value of attribute next_page.
-
#page ⇒ Object
Returns the value of attribute page.
-
#prev_page ⇒ Object
Returns the value of attribute prev_page.
-
#size ⇒ Object
Returns the value of attribute size.
Instance Method Summary collapse
- #count ⇒ Object
-
#initialize {|_self| ... } ⇒ BasePage
constructor
A new instance of BasePage.
-
#render ⇒ Object
TODO: implement me…
Constructor Details
#initialize {|_self| ... } ⇒ BasePage
Returns a new instance of BasePage.
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 |
#content ⇒ Object
Returns the value of attribute content.
8 9 10 |
# File 'lib/paginater/page/base_page.rb', line 8 def content @content end |
#links ⇒ Object
Returns the value of attribute links.
10 11 12 |
# File 'lib/paginater/page/base_page.rb', line 10 def links @links end |
#next_page ⇒ Object
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 |
#page ⇒ Object
Returns the value of attribute page.
8 9 10 |
# File 'lib/paginater/page/base_page.rb', line 8 def page @page end |
#prev_page ⇒ Object
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 |
#size ⇒ Object
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
#count ⇒ Object
21 22 23 |
# File 'lib/paginater/page/base_page.rb', line 21 def count @content.count ||= 1 end |
#render ⇒ Object
TODO: implement me…
25 26 27 |
# File 'lib/paginater/page/base_page.rb', line 25 def render @code.call self end |