Class: DiffbotSimple::V2::Client
- Inherits:
-
Object
- Object
- DiffbotSimple::V2::Client
- Defined in:
- lib/diffbot_simple/v2/client.rb
Instance Method Summary collapse
- #analyze ⇒ Object
- #article ⇒ Object
- #crawlbot ⇒ Object
- #custom(name: nil) ⇒ Object
- #image ⇒ Object
-
#initialize(token: nil) ⇒ Client
constructor
A new instance of Client.
- #product ⇒ Object
Constructor Details
#initialize(token: nil) ⇒ Client
Returns a new instance of Client.
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
#analyze ⇒ Object
24 25 26 |
# File 'lib/diffbot_simple/v2/client.rb', line 24 def analyze Analyze.new api_client: api_client, token: token end |
#article ⇒ Object
12 13 14 |
# File 'lib/diffbot_simple/v2/client.rb', line 12 def article Article.new api_client: api_client, token: token end |
#crawlbot ⇒ Object
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 |
#image ⇒ Object
21 22 23 |
# File 'lib/diffbot_simple/v2/client.rb', line 21 def image Image.new api_client: api_client, token: token end |
#product ⇒ Object
18 19 20 |
# File 'lib/diffbot_simple/v2/client.rb', line 18 def product Product.new api_client: api_client, token: token end |