Module: Card::Set::Abstract::Search::Format

Extended by:
Card::Set::AbstractFormat
Defined in:
platypus/tmp/set/gem-defaults/mod009-search/abstract/0_search.rb

Instance Method Summary collapse

Instance Method Details

#count_with_paramsObject



66
67
68
# File 'platypus/tmp/set/gem-defaults/mod009-search/abstract/0_search.rb', line 66

def count_with_params
  @count_with_params ||= search_with_rescue search_params.merge(return: :count)
end

#implicit_item_viewObject



83
84
85
86
# File 'platypus/tmp/set/gem-defaults/mod009-search/abstract/0_search.rb', line 83

def implicit_item_view
  view = voo_items_view || default_item_view
  Card::View.normalize view
end

#rescuing_bad_query(query_args) ⇒ Object



76
77
78
79
80
81
# File 'platypus/tmp/set/gem-defaults/mod009-search/abstract/0_search.rb', line 76

def rescuing_bad_query query_args
  yield
rescue Error::BadQuery => e
  Rails.logger.info "BadQuery: #{query_args}"
  e
end

#search_with_paramsObject



62
63
64
# File 'platypus/tmp/set/gem-defaults/mod009-search/abstract/0_search.rb', line 62

def search_with_params
  @search_with_params ||= search_with_rescue search_params
end

#search_with_rescue(query_args) ⇒ Object



70
71
72
73
74
# File 'platypus/tmp/set/gem-defaults/mod009-search/abstract/0_search.rb', line 70

def search_with_rescue query_args
  rescuing_bad_query query_args do
    card.cached_search query_args
  end
end

#view: countObject



60
# File 'platypus/tmp/set/gem-defaults/mod009-search/abstract/0_search.rb', line 60

view(:count, cache: :never) { super() }