Class: ReCaptcha::SecureTokenBuilder
- Inherits:
-
Object
- Object
- ReCaptcha::SecureTokenBuilder
- Defined in:
- lib/re_captcha/secure_token_builder.rb
Instance Method Summary collapse
- #build ⇒ Object
-
#initialize(private_key) ⇒ SecureTokenBuilder
constructor
A new instance of SecureTokenBuilder.
Constructor Details
#initialize(private_key) ⇒ SecureTokenBuilder
Returns a new instance of SecureTokenBuilder.
8 9 10 |
# File 'lib/re_captcha/secure_token_builder.rb', line 8 def initialize(private_key) @private_key = private_key end |
Instance Method Details
#build ⇒ Object
12 13 14 15 16 17 |
# File 'lib/re_captcha/secure_token_builder.rb', line 12 def build json_token = generate_json_token private_key_digest = digest_key @private_key cipher = prepare_cipher private_key_digest encode_token json_token, cipher end |