Module: Card::Set::Abstract::Search::SearchParams::Format
- Extended by:
- Card::Set::AbstractFormat
- Defined in:
- platypus/tmp/set/gem-defaults/mod009-search/abstract/0_search/search_params.rb
Instance Method Summary collapse
-
#default_limit ⇒ Object
-
#default_search_params ⇒ Object
used for override.
-
#extra_paging_path_args ⇒ Object
-
#paging_params ⇒ Object
-
#query_params ⇒ Object
-
#search_keyword ⇒ Object
-
#search_params ⇒ Object
-
#search_vars ⇒ Object
-
#term_param ⇒ Object
-
#type_param ⇒ Object
Instance Method Details
#default_limit ⇒ Object
48 49 50 |
# File 'platypus/tmp/set/gem-defaults/mod009-search/abstract/0_search/search_params.rb', line 48 def default_limit 100 end |
#default_search_params ⇒ Object
used for override
14 15 16 17 18 19 20 |
# File 'platypus/tmp/set/gem-defaults/mod009-search/abstract/0_search/search_params.rb', line 14 def default_search_params if (qparams = query_params)&.present? paging_params.merge vars: qparams else paging_params end end |
#extra_paging_path_args ⇒ Object
52 53 54 |
# File 'platypus/tmp/set/gem-defaults/mod009-search/abstract/0_search/search_params.rb', line 52 def extra_paging_path_args (vars = query_params) ? { query: vars } : {} end |
#paging_params ⇒ Object
22 23 24 |
# File 'platypus/tmp/set/gem-defaults/mod009-search/abstract/0_search/search_params.rb', line 22 def paging_params { limit: limit, offset: offset } end |
#query_params ⇒ Object
26 27 28 |
# File 'platypus/tmp/set/gem-defaults/mod009-search/abstract/0_search/search_params.rb', line 26 def query_params (vars = params[:query]) ? Env.hash(vars) : {} end |
#search_keyword ⇒ Object
39 40 41 |
# File 'platypus/tmp/set/gem-defaults/mod009-search/abstract/0_search/search_params.rb', line 39 def search_keyword @search_keyword ||= term_param || search_vars&.dig(:keyword) end |
#search_params ⇒ Object
9 10 11 |
# File 'platypus/tmp/set/gem-defaults/mod009-search/abstract/0_search/search_params.rb', line 9 def search_params @search_params ||= default_search_params end |
#search_vars ⇒ Object
43 44 45 46 |
# File 'platypus/tmp/set/gem-defaults/mod009-search/abstract/0_search/search_params.rb', line 43 def search_vars # root.respond_to?(:search_params) ? root.search_params[:vars] : search_params[:vars] end |
#term_param ⇒ Object
35 36 37 |
# File 'platypus/tmp/set/gem-defaults/mod009-search/abstract/0_search/search_params.rb', line 35 def term_param params[:term] end |
#type_param ⇒ Object
30 31 32 33 |
# File 'platypus/tmp/set/gem-defaults/mod009-search/abstract/0_search/search_params.rb', line 30 def type_param type = query_params[:type] type.present? && type end |