Class: Howkast::Processor::Search
- Defined in:
- lib/howkast/processors/search.rb
Class Method Summary collapse
Methods inherited from Base
Class Method Details
.default_for(field) ⇒ Object
26 27 28 |
# File 'lib/howkast/processors/search.rb', line 26 def default_for field [] if %w{ videos }.include? field end |
.filter(args, options) ⇒ Object
11 12 13 14 15 16 17 18 |
# File 'lib/howkast/processors/search.rb', line 11 def filter args, [:q] = .delete(:query) # HACK: The Howcast API service responds with HTTP500 error if the # :q parameter on search is an empty string - so we plug it with # something that *might not* exist and hopefully it will return an # empty list :-) [:q] = '6c6d1613339399efd0bc74fe12b14dd3' if [:q].empty? end |
.parse_element(data) ⇒ Object
20 21 22 23 24 |
# File 'lib/howkast/processors/search.rb', line 20 def parse_element data = ->(key, value){ key, value } klass = Howkast::Model.synthesize('Search', data) klass.new self, data, & end |