Sha256: 928c73c05166d7db53fb833f31f6ef383f2f615c389f64a1c259aa01ed5b8219

Contents?: true

Size: 1.48 KB

Versions: 6

Compression:

Stored size: 1.48 KB

Contents

# -*- encoding : utf-8 -*-
class Card; module Set; class Abstract
# Set: Abstract (SearchParams)
#
module SearchParams;
extend Card::Set
def self.source_location; "/Users/ethan/dev/decko/gem/card-mod-search/set/abstract/02_search_params.rb"; end
module Format; module_parent.send :register_set_format, Card::Format, self; extend Card::Set::AbstractFormat
  def search_params
    @search_params ||= default_search_params
  end

  # used for override
  def default_search_params
    if (qparams = query_params)
      paging_params.merge vars: qparams
    else
      paging_params
    end
  end

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

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

    Env.hash vars
  end

  def default_limit
    100
  end

  def extra_paging_path_args
    return {} unless (vars = query_params)

    { query: vars }
  end
end

module HtmlFormat; module_parent.send :register_set_format, Card::Format::HtmlFormat, self; extend Card::Set::AbstractFormat
  def default_limit
    Cardio.config.paging_limit || 20
  end
end

module JsonFormat; module_parent.send :register_set_format, Card::Format::JsonFormat, self; extend Card::Set::AbstractFormat
  def default_limit
    20
  end
end

module RssFormat; module_parent.send :register_set_format, Card::Format::RssFormat, self; extend Card::Set::AbstractFormat
  def default_limit
    25
  end
end
end;end;end;end;
# ~~ generated from /Users/ethan/dev/decko/gem/card-mod-search/set/abstract/02_search_params.rb ~~

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
card-1.101.5 tmpsets/set/mod035-card-mod-search/abstract/02_search_params.rb
card-1.101.4 tmpsets/set/mod035-card-mod-search/abstract/02_search_params.rb
card-1.101.3 tmpsets/set/mod035-card-mod-search/abstract/02_search_params.rb
card-1.101.2 tmpsets/set/mod035-card-mod-search/abstract/02_search_params.rb
card-1.101.1 tmpsets/set/mod035-card-mod-search/abstract/02_search_params.rb
card-1.101.0 tmpsets/set/mod035-card-mod-search/abstract/02_search_params.rb