Sha256: 41a0d71566eb98391eac8a15982b1a3996427d8581b8e8fcacd315e05617b064

Contents?: true

Size: 349 Bytes

Versions: 11

Compression:

Stored size: 349 Bytes

Contents

module TwoCaptcha
  # Model of a Captcha returned by ZeroCaptcha API.
  #
  class Captcha < TwoCaptcha::Model
    attr_accessor :id, :text, :api_response

    def indexes
      text.gsub('click:', '').split(/[^0-9]/).map(&:to_i)
    end

    def coordinates
      text.scan(/x=([0-9]+),y=([0-9]+)/).map { |x, y| [x.to_i, y.to_i] }
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
two_captcha-1.9.0 lib/two_captcha/models/captcha.rb
two_captcha-1.8.0 lib/two_captcha/models/captcha.rb
two_captcha-1.7.0 lib/two_captcha/models/captcha.rb
two_captcha-1.6.0 lib/two_captcha/models/captcha.rb
two_captcha-1.5.0 lib/two_captcha/models/captcha.rb
two_captcha-1.4.0 lib/two_captcha/models/captcha.rb
two_captcha-1.3.2 lib/two_captcha/models/captcha.rb
two_captcha-1.3.1 lib/two_captcha/models/captcha.rb
two_captcha-1.3.0 lib/two_captcha/models/captcha.rb
two_captcha-1.2.0 lib/two_captcha/models/captcha.rb
two_captcha-1.1.0 lib/two_captcha/models/captcha.rb