Module: Shamu::Entities::ListScope::ScopedPaging

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

Overview

Include paging parsing and attributes exposed as a nested page object. Adds the following attributes to the list scope:

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

scope = UsersListScope.coerce!( page: { number: 5, size: 50 } )
scope.page.number # => 5
scope.page.size   # => 50

Defined Under Namespace

Classes: PageScope

Attributes collapse

Instance Method Summary collapse

Instance Attribute Details

#pagePageScope

Returns the paging scope.

Returns:



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

Instance Method Details

#scoped_page?Boolean

Returns true if the scope is paged.

Returns:

  • (Boolean)

    true if the scope is paged.



36
37
38
# File 'lib/shamu/entities/list_scope/scoped_paging.rb', line 36

def scoped_page?
  !!page.number
end