Class: Karafka::Web::Ui::Lib::Paginations::Base
- Inherits:
-
Object
- Object
- Karafka::Web::Ui::Lib::Paginations::Base
- Defined in:
- lib/karafka/web/ui/lib/paginations/base.rb
Overview
We do not use _page
explicitly to indicate, that the page scope may not operate on numerable pages (1,2,3,4) but can operate on offsets or times, etc. _offset
is more general and may refer to many types of pagination.
Abstraction on top of pagination, so we can alter pagination key and other things for non-standard pagination views (non page based, etc)
Direct Known Subclasses
Instance Attribute Summary collapse
-
#current_offset ⇒ Object
readonly
Returns the value of attribute current_offset.
-
#next_offset ⇒ Object
readonly
Returns the value of attribute next_offset.
-
#previous_offset ⇒ Object
readonly
Returns the value of attribute previous_offset.
Instance Method Summary collapse
-
#current_offset? ⇒ Boolean
Should we show current offset.
-
#first_offset ⇒ String
First offset url value.
-
#first_offset? ⇒ Boolean
Should first offset link be active.
-
#next_offset? ⇒ Boolean
Should we show next offset pagination.
-
#offset_key ⇒ String
The url offset key.
-
#paginate? ⇒ Boolean
Should we show pagination at all.
-
#previous_offset? ⇒ Boolean
Should previous offset link be active.
Instance Attribute Details
#current_offset ⇒ Object (readonly)
Returns the value of attribute current_offset.
16 17 18 |
# File 'lib/karafka/web/ui/lib/paginations/base.rb', line 16 def current_offset @current_offset end |
#next_offset ⇒ Object (readonly)
Returns the value of attribute next_offset.
16 17 18 |
# File 'lib/karafka/web/ui/lib/paginations/base.rb', line 16 def next_offset @next_offset end |
#previous_offset ⇒ Object (readonly)
Returns the value of attribute previous_offset.
16 17 18 |
# File 'lib/karafka/web/ui/lib/paginations/base.rb', line 16 def previous_offset @previous_offset end |
Instance Method Details
#current_offset? ⇒ Boolean
Returns Should we show current offset. If false, the current offset link will not be visible at all. Useful for non-linear pagination.
42 43 44 |
# File 'lib/karafka/web/ui/lib/paginations/base.rb', line 42 def current_offset? raise NotImplementedError, 'Implement in a subclass' end |
#first_offset ⇒ String
Returns first offset url value.
30 31 32 |
# File 'lib/karafka/web/ui/lib/paginations/base.rb', line 30 def first_offset raise NotImplementedError, 'Implement in a subclass' end |
#first_offset? ⇒ Boolean
Returns Should first offset link be active. If false, the first offset link will be disabled.
25 26 27 |
# File 'lib/karafka/web/ui/lib/paginations/base.rb', line 25 def first_offset? raise NotImplementedError, 'Implement in a subclass' end |
#next_offset? ⇒ Boolean
Returns Should we show next offset pagination. If false, next offset link will be disabled.
48 49 50 |
# File 'lib/karafka/web/ui/lib/paginations/base.rb', line 48 def next_offset? raise NotImplementedError, 'Implement in a subclass' end |
#offset_key ⇒ String
Returns the url offset key.
53 54 55 |
# File 'lib/karafka/web/ui/lib/paginations/base.rb', line 53 def offset_key raise NotImplementedError, 'Implement in a subclass' end |
#paginate? ⇒ Boolean
Returns Should we show pagination at all.
19 20 21 |
# File 'lib/karafka/web/ui/lib/paginations/base.rb', line 19 def paginate? raise NotImplementedError, 'Implement in a subclass' end |
#previous_offset? ⇒ Boolean
Returns Should previous offset link be active. If false, the previous offset link will be disabled.
36 37 38 |
# File 'lib/karafka/web/ui/lib/paginations/base.rb', line 36 def previous_offset? raise NotImplementedError, 'Implement in a subclass' end |