Class: StarSearcher

Inherits:
Object
  • Object
show all
Includes:
HTTParty
Defined in:
lib/star_searcher.rb

Instance Method Summary collapse

Constructor Details

#initialize(host) ⇒ StarSearcher

Returns a new instance of StarSearcher.



7
8
9
# File 'lib/star_searcher.rb', line 7

def initialize(host)
  self.class.base_uri host
end

Instance Method Details

#by_author(author, page = 1) ⇒ Object



19
20
21
# File 'lib/star_searcher.rb', line 19

def by_author(author, page=1)
  self.class.get("/authors/#{author}.json", {:query => {:page => page}})
end

#feed(page = 1) ⇒ Object



11
12
13
# File 'lib/star_searcher.rb', line 11

def feed(page=1)
  self.class.get("/stars.json", {:query => {:page => page}})
end

#search(query, page = 1) ⇒ Object



15
16
17
# File 'lib/star_searcher.rb', line 15

def search(query, page=1)
  self.class.get("/search.json", {:query => {:q => query, :page => page}})
end