Class: Biffbot::Custom

Inherits:
Base
  • Object
show all
Defined in:
lib/biffbot/custom.rb

Instance Method Summary collapse

Methods inherited from Base

#generate_url, #parse, #parse_options

Constructor Details

#initialize(url, api_name, options = {}, token = Biffbot.token) ⇒ Hash

a new instance of Biffbot::Custom

Examples:

Biffbot::Custom('http://www.nytimes.com', 'my_cool_nytimes_api', timeout: 60) => {SOME_HASH}

Parameters:

  • url (String)

    The url to pass to your custom api

  • api_name (String)

    The name of your custom api

  • options (Hash) (defaults to: {})

    An hash of options

  • token (String) (defaults to: Biffbot.token)

    Override Biffbot.token with another token


13
14
15
16
# File 'lib/biffbot/custom.rb', line 13

def initialize url, api_name, options = {}, token = Biffbot.token
  options[:api_name] = api_name
  parse(token, 'custom', url, options)
end