Class: Railsboot::PaginationComponent

Inherits:
Component
  • Object
show all
Defined in:
app/components/railsboot/pagination_component.rb

Constant Summary

Constants inherited from Component

Component::COLORS, Component::DEFAULT_COLOR

Instance Method Summary collapse

Constructor Details

#initialize(pagy:) ⇒ PaginationComponent

Returns a new instance of PaginationComponent.



2
3
4
# File 'app/components/railsboot/pagination_component.rb', line 2

def initialize(pagy:)
  @pagy = pagy
end

Instance Method Details

#render?Boolean

Returns:

  • (Boolean)


6
7
8
# File 'app/components/railsboot/pagination_component.rb', line 6

def render?
  @pagy.present? && @pagy.pages.to_i > 1
end