Class: DiffbotSimple::V2::Client

Inherits:
Object
  • Object
show all
Defined in:
lib/diffbot_simple/v2/client.rb

Instance Method Summary collapse

Constructor Details

#initialize(token: nil) ⇒ Client

Returns a new instance of Client.

Raises:

  • (ArgumentError)


4
5
6
7
8
# File 'lib/diffbot_simple/v2/client.rb', line 4

def initialize token: nil
	raise ArgumentError.new("Must supply developer token") if token.to_s.empty?
	@token = token
	@api_client = ApiClient.new
end

Instance Method Details

#analyzeObject



24
25
26
# File 'lib/diffbot_simple/v2/client.rb', line 24

def analyze
	Analyze.new api_client: api_client, token: token
end

#articleObject



12
13
14
# File 'lib/diffbot_simple/v2/client.rb', line 12

def article
	Article.new api_client: api_client, token: token
end

#crawlbotObject



9
10
11
# File 'lib/diffbot_simple/v2/client.rb', line 9

def crawlbot
	Crawlbot.new api_client: api_client, token: token
end

#custom(name: nil) ⇒ Object



15
16
17
# File 'lib/diffbot_simple/v2/client.rb', line 15

def custom name: nil
	Custom.new api_client: api_client, token: token, name: name
end

#imageObject



21
22
23
# File 'lib/diffbot_simple/v2/client.rb', line 21

def image
	Image.new api_client: api_client, token: token
end

#productObject



18
19
20
# File 'lib/diffbot_simple/v2/client.rb', line 18

def product
	Product.new api_client: api_client, token: token
end