Class: GuardianSearcher::Search

Inherits:
Base
  • Object
show all
Defined in:
lib/guardian_searcher/search.rb

Instance Attribute Summary

Attributes inherited from Base

#api_key

Class Method Summary collapse

Methods inherited from Base

#initialize, #search, #search_editions, #search_sections, #search_tags

Constructor Details

This class inherits a constructor from GuardianSearcher::Base

Class Method Details

.search_articles(q, options = {}) ⇒ Object



5
6
7
8
# File 'lib/guardian_searcher/search.rb', line 5

def self.search_articles(q, options = {})
  searcher = GuardianSearcher::Search.new(api_key: ENV["guardian_api_key"])
  searcher.search(q, options)
end

.search_sections(q, options = {}) ⇒ Object



10
11
12
13
# File 'lib/guardian_searcher/search.rb', line 10

def self.search_sections(q, options = {})
  searcher = GuardianSearcher::Search.new(api_key: ENV["guardian_api_key"])
  searcher.search_sections(q, options)
end