Class: Array

Inherits:
Object
  • Object
show all
Defined in:
lib/mark_facets/ruby/kaminari.rb,
lib/mark_facets/ruby/will_paginate.rb

Instance Method Summary collapse

Instance Method Details

#limit_valueObject



9
10
11
# File 'lib/mark_facets/ruby/kaminari.rb', line 9

def limit_value
  10
end

#offset_valueObject



13
14
15
# File 'lib/mark_facets/ruby/kaminari.rb', line 13

def offset_value
  0
end

#to_will_paginate(options = {}) ⇒ Object



5
6
7
8
9
10
11
# File 'lib/mark_facets/ruby/will_paginate.rb', line 5

def to_will_paginate(options = {})
  options.reverse_merge!({:page => 1, :per_page => self.size + 1, :total => self.size})
  results = WillPaginate::Collection.create(options[:page], options[:per_page], options[:total]) do |pager|
    pager.replace(self)
  end
  return results
end

#total_countObject



5
6
7
# File 'lib/mark_facets/ruby/kaminari.rb', line 5

def total_count
  self.size
end