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

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

Overview

Set: Abstract (Search)

Defined Under Namespace

Modules: Format, HtmlFormat, SearchParams, Views

Constant Summary collapse

AUTOCOMPLETE_LIMIT =

number of name suggestions for autocomplete text fields

8

Constants included from Helpers

Helpers::SET_PATTERN_TEST_REGEXP

Constants included from Event::Api

Event::Api::OPTIONS

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Card::Set

reset

Methods included from I18nScope

#mod_name, #scope

Methods included from Registrar

#extended, #finalize_load, #process_base_modules, #register_set

Methods included from Helpers

#format_module, #format_modules, #method_missing, #modules, #pattern_code, #respond_to_missing?, #set_name_parts, #shortname, #underscored_name

Methods included from Card::Set::AdvancedApi

#assign_type, #attachment, #define_set_from_error, #ensure_set, #setting_opts, #stage_method

Methods included from Format

#before, #format, layout_method_name, #view, view_method_name, view_setting_method_name, wrapper_method_name

Methods included from Inheritance

#include_set, #include_set_formats

Methods included from Trait

#card_accessor, #card_reader, #card_writer, #require_field

Methods included from Event::Api

#event

Class Method Details

.source_locationObject



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

def self.source_location; "/Users/ethan/dev/decko/gem/mod/search/set/abstract/0_search.rb"; end

Instance Method Details

#cached_search(args = {}) ⇒ Object



16
17
18
19
# File 'platypus/tmp/set/gem-defaults/mod009-search/abstract/0_search.rb', line 16

def cached_search args={}
  @search_results ||= {}
  @search_results[args.to_s] ||= search args
end

#count(args = {}) ⇒ Object



41
42
43
44
45
# File 'platypus/tmp/set/gem-defaults/mod009-search/abstract/0_search.rb', line 41

def count args={}
  args[:offset] = 0
  args[:limit] = 0
  returning(:count, args) { search args }
end

#each_item_name_with_options(_content = nil) ⇒ Object

for override def item_type_id nil end



52
53
54
55
56
57
58
59
# File 'platypus/tmp/set/gem-defaults/mod009-search/abstract/0_search.rb', line 52

def each_item_name_with_options _content=nil
  options = {}
  item = fetch_query.statement[:view]
  options[:view] = item if item
  item_names.each do |name|
    yield name, options
  end
end

#item_cards(args = {}) ⇒ Object



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

def item_cards args={}
  args[:limit] ||= 0
  returning(:card, args) { search args }
end

#item_ids(args = {}) ⇒ Object



36
37
38
39
# File 'platypus/tmp/set/gem-defaults/mod009-search/abstract/0_search.rb', line 36

def item_ids args={}
  args[:limit] ||= 0
  returning(:id, args) { search args }
end

#item_names(args = {}) ⇒ Object



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

def item_names args={}
  args[:limit] ||= 0
  returning(:name, args) { search args }
end

#returning(item, args) ⇒ Object



21
22
23
24
# File 'platypus/tmp/set/gem-defaults/mod009-search/abstract/0_search.rb', line 21

def returning item, args
  args[:return] = item
  yield
end

#search(_args = {}) ⇒ Object

Raises:



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

def search _args={}
  raise Error, "search not overridden"
end