Class: Ramaze::Helper::Paginate::Paginator::DataMapperPager
- Inherits:
-
ArrayPager
- Object
- ArrayPager
- Ramaze::Helper::Paginate::Paginator::DataMapperPager
- Defined in:
- lib/ramaze/helper/paginate.rb
Overview
Wrapper for DataMapper::Collection to behave like the Sequel pagination. needs ‘datamapper’ (or ‘dm-core’ and ‘dm-aggregates’)
Instance Method Summary (collapse)
- - (Boolean) empty?
-
- (DataMapperPager) initialize(*args)
constructor
A new instance of DataMapperPager.
- - (Object) size
Methods inherited from ArrayPager
#current_page, #each, #first_page?, #last_page?, #next_page, #page_count, #prev_page
Constructor Details
- (DataMapperPager) initialize(*args)
A new instance of DataMapperPager
238 239 240 241 242 243 244 245 |
# File 'lib/ramaze/helper/paginate.rb', line 238 def initialize(*args) unless defined?(DataMapper::Aggregates) Ramaze::Log.warn "paginate.rb: it is strongly " + "recommended to require 'dm-aggregates'" end super end |
Instance Method Details
- (Boolean) empty?
251 252 253 |
# File 'lib/ramaze/helper/paginate.rb', line 251 def empty? size == 0 end |
- (Object) size
247 248 249 |
# File 'lib/ramaze/helper/paginate.rb', line 247 def size @cached_size ||= @array.count end |