Module: Card::Set::Self::Search::Format
- Extended by:
- AbstractFormat
- Defined in:
- platypus/tmp/set/gem-defaults/mod009-search/self/search.rb
Instance Method Summary collapse
-
#complete_path ⇒ Object
-
#cql_keyword? ⇒ Boolean
-
#cql_search ⇒ Object
-
#results_path(keyword) ⇒ Object
-
#search_with_params ⇒ Object
-
#view: search_error ⇒ Object
Instance Method Details
#complete_path ⇒ Object
33 34 35 36 |
# File 'platypus/tmp/set/gem-defaults/mod009-search/self/search.rb', line 33 def complete_path path mark: :search, view: :search_box_complete, format: :json # path mark: :search, view: :test, format: :json end |
#cql_keyword? ⇒ Boolean
29 30 31 |
# File 'platypus/tmp/set/gem-defaults/mod009-search/self/search.rb', line 29 def cql_keyword? search_keyword&.match?(/^\{.+\}$/) end |
#cql_search ⇒ Object
24 25 26 27 |
# File 'platypus/tmp/set/gem-defaults/mod009-search/self/search.rb', line 24 def cql_search query = card.parse_json_cql search_keyword rescuing_bad_query(query) { Card.search query } end |
#results_path(keyword) ⇒ Object
38 39 40 |
# File 'platypus/tmp/set/gem-defaults/mod009-search/self/search.rb', line 38 def results_path keyword path mark: :search, query: { keyword: keyword } end |
#search_with_params ⇒ Object
20 21 22 |
# File 'platypus/tmp/set/gem-defaults/mod009-search/self/search.rb', line 20 def search_with_params @search_with_params ||= cql_keyword? ? cql_search : super end |
#view: search_error ⇒ Object
15 16 17 18 |
# File 'platypus/tmp/set/gem-defaults/mod009-search/self/search.rb', line 15 view :search_error, cache: :never do # don't show card content; not very helpful in this case %(#{search_with_params.class} :: #{search_with_params.}) end |