module Diffbot::Base

Base common class for {Diffbot} resources

Private Instance Methods

api_url() click to toggle source

Builds the full API URL (endpoint + version)

@return [String]

# File lib/diffbot_api/base.rb, line 24
def api_url
  File.join Diffbot.api_endpoint, Diffbot.api_version
end
request() click to toggle source

Creates Faraday instance from the given url

@returns [Faraday]

# File lib/diffbot_api/base.rb, line 17
def request
  Faraday.new url: url
end
validate_diffbot_token!() click to toggle source

Validates Diffbot token is configured Raise an exception when Diffbot token is not configured

@returns [TokenNotFound]

# File lib/diffbot_api/base.rb, line 32
def validate_diffbot_token!
  raise TokenNotFound unless Diffbot.token
end