Module: Card::Set::Abstract::SearchParams::Format

Extended by:
Card::Set::AbstractFormat
Defined in:
card/tmpsets/set/mod035-card-mod-search/abstract/02_search_params.rb,
card/tmpsets/set/mod036-card-mod-search/abstract/02_search_params.rb

Instance Method Summary collapse

Instance Method Details

#default_limitObject



32
33
34
# File 'card/tmpsets/set/mod035-card-mod-search/abstract/02_search_params.rb', line 32

def default_limit
  100
end

#default_search_paramsObject

used for override



14
15
16
17
18
19
20
# File 'card/tmpsets/set/mod035-card-mod-search/abstract/02_search_params.rb', line 14

def default_search_params
  if (qparams = query_params)
    paging_params.merge vars: qparams
  else
    paging_params
  end
end

#extra_paging_path_argsObject



36
37
38
39
40
# File 'card/tmpsets/set/mod035-card-mod-search/abstract/02_search_params.rb', line 36

def extra_paging_path_args
  return {} unless (vars = query_params)

  { query: vars }
end

#paging_paramsObject



22
23
24
# File 'card/tmpsets/set/mod035-card-mod-search/abstract/02_search_params.rb', line 22

def paging_params
  { limit: limit, offset: offset }
end

#query_paramsObject



26
27
28
29
30
# File 'card/tmpsets/set/mod035-card-mod-search/abstract/02_search_params.rb', line 26

def query_params
  return nil unless (vars = params[:query])

  Env.hash vars
end

#search_paramsObject



9
10
11
# File 'card/tmpsets/set/mod035-card-mod-search/abstract/02_search_params.rb', line 9

def search_params
  @search_params ||= default_search_params
end