Class: Paginator::PagesGroup
- Inherits:
-
Object
- Object
- Paginator::PagesGroup
- Defined in:
- lib/middleman/paginator/pages_group.rb
Instance Attribute Summary collapse
-
#count ⇒ Object
readonly
Returns the value of attribute count.
-
#current ⇒ Object
readonly
Returns the value of attribute current.
-
#last ⇒ Object
readonly
Returns the value of attribute last.
Instance Method Summary collapse
- #generate ⇒ Object
-
#initialize(current:, last:, count:) ⇒ PagesGroup
constructor
A new instance of PagesGroup.
Constructor Details
#initialize(current:, last:, count:) ⇒ PagesGroup
Returns a new instance of PagesGroup.
4 5 6 7 8 |
# File 'lib/middleman/paginator/pages_group.rb', line 4 def initialize(current:, last:, count:) @last = last @current = current @count = count end |
Instance Attribute Details
#count ⇒ Object (readonly)
Returns the value of attribute count.
2 3 4 |
# File 'lib/middleman/paginator/pages_group.rb', line 2 def count @count end |
#current ⇒ Object (readonly)
Returns the value of attribute current.
2 3 4 |
# File 'lib/middleman/paginator/pages_group.rb', line 2 def current @current end |
#last ⇒ Object (readonly)
Returns the value of attribute last.
2 3 4 |
# File 'lib/middleman/paginator/pages_group.rb', line 2 def last @last end |
Instance Method Details
#generate ⇒ Object
10 11 12 13 14 |
# File 'lib/middleman/paginator/pages_group.rb', line 10 def generate (first_page..last_page).each do |page_number| yield(page_number) end end |