Class: PhlexKit::DataTablePagyAdapter

Inherits:
Object
  • Object
show all
Defined in:
app/components/phlex_kit/data_table/data_table_pagy_adapter.rb

Overview

Adapter exposing a Pagy object to PhlexKit::DataTablePagination (the gem is the host's dependency, not ours). Ported from ruby_ui.

Instance Method Summary collapse

Constructor Details

#initialize(pagy) ⇒ DataTablePagyAdapter

Returns a new instance of DataTablePagyAdapter.



5
6
7
# File 'app/components/phlex_kit/data_table/data_table_pagy_adapter.rb', line 5

def initialize(pagy)
  @pagy = pagy
end

Instance Method Details

#current_pageObject



9
# File 'app/components/phlex_kit/data_table/data_table_pagy_adapter.rb', line 9

def current_page = @pagy.page

#per_pageObject



15
# File 'app/components/phlex_kit/data_table/data_table_pagy_adapter.rb', line 15

def per_page = @pagy.items

#total_countObject



13
# File 'app/components/phlex_kit/data_table/data_table_pagy_adapter.rb', line 13

def total_count = @pagy.count

#total_pagesObject



11
# File 'app/components/phlex_kit/data_table/data_table_pagy_adapter.rb', line 11

def total_pages = @pagy.pages