module Goodreads::Authors

Public Instance Methods

author(id, params = {}) click to toggle source

Get author details

# File lib/goodreads/client/authors.rb, line 5
def author(id, params = {})
  params[:id] = id
  data = request("/author/show", params)
  Hashie::Mash.new(data["author"])
end
author_books(id, params = {}) click to toggle source

Get an author's books

# File lib/goodreads/client/authors.rb, line 13
def author_books(id, params = {})
  params[:id] = id
  data = request("/author/list", params)
  Hashie::Mash.new(data["author"])
end
author_by_name(name, params = {}) click to toggle source

Search for an author by name

# File lib/goodreads/client/authors.rb, line 21
def author_by_name(name, params = {})
  params[:id] = name
  name_encoded = URI.encode(name)
  data = request("/api/author_url/#{name_encoded}", params)
  Hashie::Mash.new(data["author"])
end