Module: Redd::Client::Unauthenticated::Captcha

Included in:
Redd::Client::Unauthenticated
Defined in:
lib/redd/client/unauthenticated/captcha.rb

Instance Method Summary collapse

Instance Method Details

#captcha_url(identifier) ⇒ Object



14
15
16
# File 'lib/redd/client/unauthenticated/captcha.rb', line 14

def captcha_url(identifier)
  "http://www.reddit.com/captcha/#{identifier}.png"
end

#needs_captcha?Boolean

Returns:

  • (Boolean)


5
6
7
# File 'lib/redd/client/unauthenticated/captcha.rb', line 5

def needs_captcha?
  get "/api/needs_captcha.json"
end

#new_captchaObject



9
10
11
12
# File 'lib/redd/client/unauthenticated/captcha.rb', line 9

def new_captcha
  response = get "/api/new_captcha", api_type: "json"
  response[:json][:data][:iden]
end