Class: ISBNdb::Api::Subject

Inherits:
Object
  • Object
show all
Defined in:
lib/isbndb/api/subject.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ Subject

Returns a new instance of Subject.



6
7
8
# File 'lib/isbndb/api/subject.rb', line 6

def initialize(client:)
  @client = client
end

Instance Attribute Details

#clientObject (readonly)

Returns the value of attribute client.



4
5
6
# File 'lib/isbndb/api/subject.rb', line 4

def client
  @client
end

Instance Method Details

#batch(query, options = {}) ⇒ Object



14
15
16
# File 'lib/isbndb/api/subject.rb', line 14

def batch(query, options = {})
  @client.request("/subjects/#{query}", options)
end

#find(name) ⇒ Object



10
11
12
# File 'lib/isbndb/api/subject.rb', line 10

def find(name)
  @client.request("/subject/#{name}")
end

#search(options = {}) ⇒ Object



18
19
20
# File 'lib/isbndb/api/subject.rb', line 18

def search(options = {})
  @client.request("/search/subjects/", options)
end