Class: Yunpian::Captcha::AuthService
- Inherits:
-
Object
- Object
- Yunpian::Captcha::AuthService
- Defined in:
- lib/yunpian/captcha/auth_service.rb
Constant Summary collapse
- PARAMS =
%w[captchaId token authenticate secretId version user timestamp nonce signature]
Instance Attribute Summary collapse
-
#authenticate ⇒ Object
readonly
Returns the value of attribute authenticate.
-
#config ⇒ Object
readonly
Returns the value of attribute config.
-
#token ⇒ Object
readonly
Returns the value of attribute token.
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(token, authenticate, config = Yunpian::Captcha.config) ⇒ AuthService
constructor
A new instance of AuthService.
Constructor Details
#initialize(token, authenticate, config = Yunpian::Captcha.config) ⇒ AuthService
Returns a new instance of AuthService.
9 10 11 |
# File 'lib/yunpian/captcha/auth_service.rb', line 9 def initialize(token, authenticate, config = Yunpian::Captcha.config) @config, @token, @authenticate = config, token, authenticate end |
Instance Attribute Details
#authenticate ⇒ Object (readonly)
Returns the value of attribute authenticate.
8 9 10 |
# File 'lib/yunpian/captcha/auth_service.rb', line 8 def authenticate @authenticate end |
#config ⇒ Object (readonly)
Returns the value of attribute config.
8 9 10 |
# File 'lib/yunpian/captcha/auth_service.rb', line 8 def config @config end |
#token ⇒ Object (readonly)
Returns the value of attribute token.
8 9 10 |
# File 'lib/yunpian/captcha/auth_service.rb', line 8 def token @token end |
Instance Method Details
#call ⇒ Object
13 14 15 16 17 |
# File 'lib/yunpian/captcha/auth_service.rb', line 13 def call log :debug, 'verifying' signed_params = sign(build_params) valid?(signed_params) end |