Module: Card::Set::Abstract::SearchParams::Format
- Extended by:
- Card::Set::AbstractFormat
- Defined in:
- tmpsets/set/mod020-search/abstract/02_search_params.rb
Instance Method Summary collapse
- #default_limit ⇒ Object
-
#default_search_params ⇒ Object
used for override.
- #extra_paging_path_args ⇒ Object
- #offset ⇒ Object
- #paging_params ⇒ Object
- #query_params ⇒ Object
- #search_params ⇒ Object
Instance Method Details
#default_limit ⇒ Object
38 39 40 |
# File 'tmpsets/set/mod020-search/abstract/02_search_params.rb', line 38 def default_limit 100 end |
#default_search_params ⇒ Object
used for override
20 21 22 23 24 25 26 |
# File 'tmpsets/set/mod020-search/abstract/02_search_params.rb', line 20 def default_search_params if (qparams = query_params) paging_params.merge vars: qparams else paging_params end end |
#extra_paging_path_args ⇒ Object
42 43 44 45 46 |
# File 'tmpsets/set/mod020-search/abstract/02_search_params.rb', line 42 def extra_paging_path_args return {} unless (vars = query_params) { query: vars } end |
#offset ⇒ Object
11 12 13 |
# File 'tmpsets/set/mod020-search/abstract/02_search_params.rb', line 11 def offset search_params[:offset] || 0 end |
#paging_params ⇒ Object
28 29 30 |
# File 'tmpsets/set/mod020-search/abstract/02_search_params.rb', line 28 def paging_params { limit: limit_param, offset: offset_param } end |
#query_params ⇒ Object
32 33 34 35 36 |
# File 'tmpsets/set/mod020-search/abstract/02_search_params.rb', line 32 def query_params return nil unless (vars = params[:query]) Card.safe_param vars end |
#search_params ⇒ Object
15 16 17 |
# File 'tmpsets/set/mod020-search/abstract/02_search_params.rb', line 15 def search_params @search_params ||= default_search_params end |