Class: Readernaut

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

Class Method Summary collapse

Class Method Details

.books(username, options = {}) ⇒ Object



14
15
16
17
18
19
# File 'lib/readernaut.rb', line 14

def self.books(username, options={})
  path = "/#{username}/books/"
  list = options.delete(:list)
  path += "#{list}/" unless list.blank?
  Mash.new self.get(path, :query => options)
end

.books_abandoned(username, options = {}) ⇒ Object



46
47
48
49
# File 'lib/readernaut.rb', line 46

def self.books_abandoned(username, options={})
  opts = options.merge({:list => 'abandoned'})
  self.books(username, opts)
end

.books_finished(username, options = {}) ⇒ Object



21
22
23
24
# File 'lib/readernaut.rb', line 21

def self.books_finished(username, options={})
  opts = options.merge({:list => 'finished'})
  self.books(username, opts)
end

.books_plan_to_read(username, options = {}) ⇒ Object



31
32
33
34
# File 'lib/readernaut.rb', line 31

def self.books_plan_to_read(username, options={})
  opts = options.merge({:list => 'plan-to-read'})
  self.books(username, opts)
end

.books_reading(username, options = {}) ⇒ Object



26
27
28
29
# File 'lib/readernaut.rb', line 26

def self.books_reading(username, options={})
  opts = options.merge({:list => 'reading'})
  self.books(username, opts)
end

.books_reference(username, options = {}) ⇒ Object



36
37
38
39
# File 'lib/readernaut.rb', line 36

def self.books_reference(username, options={})
  opts = options.merge({:list => 'reference'})
  self.books(username, opts)
end

.books_wishlist(username, options = {}) ⇒ Object



41
42
43
44
# File 'lib/readernaut.rb', line 41

def self.books_wishlist(username, options={})
  opts = options.merge({:list => 'wishlist'})
  self.books(username, opts)
end

.contacts(username, options = {}) ⇒ Object



55
56
57
# File 'lib/readernaut.rb', line 55

def self.contacts(username, options={})
  Mash.new self.get("/#{username}/contacts/", :query => options)
end

.notes(username, options = {}) ⇒ Object



51
52
53
# File 'lib/readernaut.rb', line 51

def self.notes(username, options={})
  Mash.new self.get("/#{username}/notes/", :query => options)
end