Class: CursorPager::Configuration
- Inherits:
-
Object
- Object
- CursorPager::Configuration
- Defined in:
- lib/cursor_pager/configuration.rb
Overview
Encapulates all the configuration for the library.
Instance Attribute Summary collapse
-
#default_page_size ⇒ Object
The default page size that will be used if no ‘first` or `last` were specified.
-
#encoder ⇒ Object
The encoder that will be used to encode & decode cursors.
-
#maximum_page_size ⇒ Object
The maximum allowed page size.
Instance Method Summary collapse
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
22 23 24 25 26 |
# File 'lib/cursor_pager/configuration.rb', line 22 def initialize @encoder = Base64Encoder @default_page_size = nil @maximum_page_size = nil end |
Instance Attribute Details
#default_page_size ⇒ Object
The default page size that will be used if no ‘first` or `last` were specified. Every record fitting the cursor constraints will be returned if it’s set to ‘nil`. Defaults to `nil`.
15 16 17 |
# File 'lib/cursor_pager/configuration.rb', line 15 def default_page_size @default_page_size end |
#encoder ⇒ Object
The encoder that will be used to encode & decode cursors. Defaults to ‘Base64Encoder`.
9 10 11 |
# File 'lib/cursor_pager/configuration.rb', line 9 def encoder @encoder end |
#maximum_page_size ⇒ Object
The maximum allowed page size. Clients will never receive more records per page than is sepcified here. There is no maximum if this is set to ‘nil`. Defaults to `nil`.
20 21 22 |
# File 'lib/cursor_pager/configuration.rb', line 20 def maximum_page_size @maximum_page_size end |