Module: Redd::Clients::Base::None
- Included in:
- Redd::Clients::Base
- Defined in:
- lib/redd/clients/base/none.rb
Overview
Methods that don’t require any scope.
Instance Method Summary collapse
-
#captcha_url(iden) ⇒ Object
The url for the captcha image.
-
#needs_captcha? ⇒ Boolean
Whether a captcha is required for some API methods.
-
#new_captcha ⇒ String
Create a new captcha identifier.
Instance Method Details
#captcha_url(iden) ⇒ Object
Returns The url for the captcha image.
21 22 23 |
# File 'lib/redd/clients/base/none.rb', line 21 def captcha_url(iden) "http://www.reddit.com/captcha/#{iden}.png" end |
#needs_captcha? ⇒ Boolean
Returns Whether a captcha is required for some API methods.
7 8 9 |
# File 'lib/redd/clients/base/none.rb', line 7 def needs_captcha? get('/api/needs_captcha.json').body end |
#new_captcha ⇒ String
TODO:
Maybe create some kind of set_captcha!(…) method for the client to send automatically with the next response.
Create a new captcha identifier.
15 16 17 |
# File 'lib/redd/clients/base/none.rb', line 15 def new_captcha post('/api/new_captcha').body[:json][:data][:iden] end |