Module: Card::Set::Abstract::Paging::Format

Extended by:
Card::Set::AbstractFormat
Defined in:
tmpsets/set/mod008-pointer/abstract/01_paging.rb

Instance Method Summary collapse

Instance Method Details

#count_with_paramsObject



23
24
25
# File 'tmpsets/set/mod008-pointer/abstract/01_paging.rb', line 23

def count_with_params
  card.item_names.count
end

#current_pageObject



32
33
34
# File 'tmpsets/set/mod008-pointer/abstract/01_paging.rb', line 32

def current_page
  (offset / limit).to_i
end

#extra_paging_path_argsObject

for override



37
38
39
# File 'tmpsets/set/mod008-pointer/abstract/01_paging.rb', line 37

def extra_paging_path_args
  {}
end

#limitObject



11
12
13
# File 'tmpsets/set/mod008-pointer/abstract/01_paging.rb', line 11

def limit
  limit_param
end

#offsetObject



15
16
17
# File 'tmpsets/set/mod008-pointer/abstract/01_paging.rb', line 15

def offset
  offset_param
end

#search_with_paramsObject



19
20
21
# File 'tmpsets/set/mod008-pointer/abstract/01_paging.rb', line 19

def search_with_params
  card.item_names
end

#total_pagesObject



27
28
29
30
# File 'tmpsets/set/mod008-pointer/abstract/01_paging.rb', line 27

def total_pages
  return 1 if limit.zero?
  ((count_with_params - 1) / limit).to_i
end