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

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

Instance Method Summary collapse

Instance Method Details

#item_cardsObject



33
34
35
# File 'platypus/tmp/set/gem-defaults/mod009-search/abstract/0_search/views.rb', line 33

def item_cards
  search_with_params
end

#view: card_listObject



17
18
19
20
21
22
23
# File 'platypus/tmp/set/gem-defaults/mod009-search/abstract/0_search/views.rb', line 17

view :card_list, cache: :never do
  with_results do
    search_with_params.map do |item_card|
      nest_item item_card
    end.join "\n"
  end
end

#view: no_search_resultsObject



25
26
27
# File 'platypus/tmp/set/gem-defaults/mod009-search/abstract/0_search/views.rb', line 25

view :no_search_results do
  "no results"
end

#view: search_countObject



9
10
11
# File 'platypus/tmp/set/gem-defaults/mod009-search/abstract/0_search/views.rb', line 9

view :search_count, cache: :never do
  search_with_params.to_s
end

#view: search_errorObject



13
14
15
# File 'platypus/tmp/set/gem-defaults/mod009-search/abstract/0_search/views.rb', line 13

view :search_error, cache: :never do
  %(#{search_with_params.class} :: #{search_with_params.message} :: #{card.content})
end

#with_resultsObject



29
30
31
# File 'platypus/tmp/set/gem-defaults/mod009-search/abstract/0_search/views.rb', line 29

def with_results
  search_with_params.empty? ? render_no_search_results : yield
end