Module: Shamu::Entities::ListScope::Paging

Defined in:
lib/shamu/entities/list_scope/paging.rb

Overview

Include paging parsing and attributes. Adds the following attributes to the list scope:

class UsersListScope < Shamu::Entities::ListScope
  include Shamu::Entities::ListScope::Paging
end

scope = UsersListScope.coerce!( params )
scope.page      # => 1
scope.per_page # => 25

Attributes collapse

Instance Method Summary collapse

Instance Attribute Details

#default_per_pageInteger



# File 'lib/shamu/entities/list_scope/paging.rb', line 29


#pageInteger



# File 'lib/shamu/entities/list_scope/paging.rb', line 23


#per_pageInteger



# File 'lib/shamu/entities/list_scope/paging.rb', line 26


Instance Method Details

#paged?Boolean



44
45
46
# File 'lib/shamu/entities/list_scope/paging.rb', line 44

def paged?
  !!page
end