Method: TwoCaptcha::Client#initialize

Defined in:
lib/two_captcha/client.rb

#initialize(key, options = {}) ⇒ TwoCaptcha::Client

Create a TwoCaptcha API client.

Parameters:

  • Captcha (String)

    key of the TwoCaptcha account.

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

    Options hash.

Options Hash (options):

  • :timeout (Integer) — default: 60

    Seconds before giving up of a captcha being solved.

  • :polling (Integer) — default: 5

    Seconds before check_answer again



20
21
22
23
24
# File 'lib/two_captcha/client.rb', line 20

def initialize(key, options = {})
  self.key     = key
  self.timeout = options[:timeout] || 60
  self.polling = options[:polling] || 5
end