Class: Jekyll::Plugins::PaginateV3::Pagination::GroupPayload
- Inherits:
-
Liquid::Drop
- Object
- Liquid::Drop
- Jekyll::Plugins::PaginateV3::Pagination::GroupPayload
- Defined in:
- lib/jekyll-paginate-v3/pagination/paginator/group_payload.rb
Overview
Liquid-facing grouped-set payload for generated grouped indexes.
Exposed in paginator.groups and by shortcut at paginator.group
(deepest index level).
Instance Attribute Summary collapse
-
#current ⇒ Object
readonly
Returns the value of attribute current.
-
#first ⇒ Object
readonly
Returns the value of attribute first.
-
#key ⇒ Object
readonly
Returns the value of attribute key.
-
#last ⇒ Object
readonly
Returns the value of attribute last.
-
#next ⇒ Object
readonly
Returns the value of attribute next.
-
#previous ⇒ Object
readonly
Returns the value of attribute previous.
Instance Method Summary collapse
-
#initialize(key:, current:, next_reference:, first_reference:, last_reference:, previous_reference: nil, prev_reference: nil) ⇒ GroupPayload
constructor
Stores one complete set of group neighbour references.
-
#prev ⇒ Object
Backwards-compatible alias for previous grouped-set reference.
-
#to_h ⇒ Object
Hash form used by specs and non-Liquid inspection.
Constructor Details
#initialize(key:, current:, next_reference:, first_reference:, last_reference:, previous_reference: nil, prev_reference: nil) ⇒ GroupPayload
Stores one complete set of group neighbour references.
Use previous_reference going forward; prev_reference remains as
a backwards-compatible alias.
20 21 22 23 24 25 26 27 |
# File 'lib/jekyll-paginate-v3/pagination/paginator/group_payload.rb', line 20 def initialize(key:, current:, next_reference:, first_reference:, last_reference:, previous_reference: nil, prev_reference: nil) @key = key.to_s @current = current @next = next_reference @previous = previous_reference.nil? ? prev_reference : previous_reference @first = first_reference @last = last_reference end |
Instance Attribute Details
#current ⇒ Object (readonly)
Returns the value of attribute current.
14 15 16 |
# File 'lib/jekyll-paginate-v3/pagination/paginator/group_payload.rb', line 14 def current @current end |
#first ⇒ Object (readonly)
Returns the value of attribute first.
14 15 16 |
# File 'lib/jekyll-paginate-v3/pagination/paginator/group_payload.rb', line 14 def first @first end |
#key ⇒ Object (readonly)
Returns the value of attribute key.
14 15 16 |
# File 'lib/jekyll-paginate-v3/pagination/paginator/group_payload.rb', line 14 def key @key end |
#last ⇒ Object (readonly)
Returns the value of attribute last.
14 15 16 |
# File 'lib/jekyll-paginate-v3/pagination/paginator/group_payload.rb', line 14 def last @last end |
#next ⇒ Object (readonly)
Returns the value of attribute next.
14 15 16 |
# File 'lib/jekyll-paginate-v3/pagination/paginator/group_payload.rb', line 14 def next @next end |
#previous ⇒ Object (readonly)
Returns the value of attribute previous.
14 15 16 |
# File 'lib/jekyll-paginate-v3/pagination/paginator/group_payload.rb', line 14 def previous @previous end |
Instance Method Details
#prev ⇒ Object
Backwards-compatible alias for previous grouped-set reference.
30 31 32 |
# File 'lib/jekyll-paginate-v3/pagination/paginator/group_payload.rb', line 30 def prev previous end |
#to_h ⇒ Object
Hash form used by specs and non-Liquid inspection.
35 36 37 38 39 40 41 42 43 44 45 |
# File 'lib/jekyll-paginate-v3/pagination/paginator/group_payload.rb', line 35 def to_h { 'key' => key, 'current' => current, 'next' => self.next, 'previous' => previous, 'prev' => prev, 'first' => first, 'last' => last } end |