Class: Shamu::Entities::ListScope::ScopedPaging::PageScope

Inherits:
Object
  • Object
show all
Includes:
Attributes
Defined in:
lib/shamu/entities/list_scope/scoped_paging.rb

Overview

The scope of a [ScopedPaging] list scope.

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Attributes

#[], #as_json, #assign_attributes, association, associations, attribute, #attribute?, attributes, #initialize, #pretty_print, #set?, #slice, #to_attributes, #to_json

Instance Attribute Details

#default_sizeInteger

Returns the default page size if not specified.

Returns:

  • (Integer)

    the default page size if not specified.



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

attribute :default_size, coerce: :to_i, default: 25, serialize: false

#numberInteger

Returns the page number.

Returns:

  • (Integer)

    the page number.



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

attribute :number, coerce: :to_i

#sizeInteger

Returns the size of each page.

Returns:

  • (Integer)

    the size of each page.



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

attribute :size, coerce: :to_i, default: ->() { default_size }

Instance Method Details

#paramsHash

Returns the scope as a params hash.

Returns:

  • (Hash)

    the scope as a params hash.



57
58
59
# File 'lib/shamu/entities/list_scope/scoped_paging.rb', line 57

def params
  to_attributes
end