Class: Uchi::Ui::Pagination::Item
- Inherits:
-
ViewComponent::Base
- Object
- ViewComponent::Base
- Uchi::Ui::Pagination::Item
- Defined in:
- app/components/uchi/ui/pagination/item.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#page_number ⇒ Object
readonly
Returns the value of attribute page_number.
-
#paginator ⇒ Object
readonly
Returns the value of attribute paginator.
Instance Method Summary collapse
-
#initialize(paginator:, page_number: nil) ⇒ Item
constructor
A new instance of Item.
-
#page_url(page) ⇒ Object
Returns the URL for a given page.
Constructor Details
#initialize(paginator:, page_number: nil) ⇒ Item
Returns a new instance of Item.
10 11 12 13 14 |
# File 'app/components/uchi/ui/pagination/item.rb', line 10 def initialize(paginator:, page_number: nil) super() @page_number = page_number @paginator = paginator end |
Instance Attribute Details
#page_number ⇒ Object (readonly)
Returns the value of attribute page_number.
7 8 9 |
# File 'app/components/uchi/ui/pagination/item.rb', line 7 def page_number @page_number end |
#paginator ⇒ Object (readonly)
Returns the value of attribute paginator.
7 8 9 |
# File 'app/components/uchi/ui/pagination/item.rb', line 7 def paginator @paginator end |
Instance Method Details
#page_url(page) ⇒ Object
Returns the URL for a given page. page can be a number, of :first, :last, :previous, :next, :current.
18 19 20 |
# File 'app/components/uchi/ui/pagination/item.rb', line 18 def page_url(page) paginator.page_url(page) end |