Class: Turnstile::Verification
- Inherits:
-
Object
- Object
- Turnstile::Verification
- Defined in:
- lib/turnstile/verification.rb
Instance Attribute Summary collapse
-
#remote_ip ⇒ Object
readonly
Returns the value of attribute remote_ip.
-
#response ⇒ Object
readonly
Returns the value of attribute response.
Instance Method Summary collapse
-
#initialize(response:, remote_ip:) ⇒ Verification
constructor
A new instance of Verification.
- #result ⇒ Object
- #success? ⇒ Boolean
Constructor Details
#initialize(response:, remote_ip:) ⇒ Verification
Returns a new instance of Verification.
9 10 11 12 |
# File 'lib/turnstile/verification.rb', line 9 def initialize(response:, remote_ip:) @response = response @remote_ip = remote_ip end |
Instance Attribute Details
#remote_ip ⇒ Object (readonly)
Returns the value of attribute remote_ip.
7 8 9 |
# File 'lib/turnstile/verification.rb', line 7 def remote_ip @remote_ip end |
#response ⇒ Object (readonly)
Returns the value of attribute response.
7 8 9 |
# File 'lib/turnstile/verification.rb', line 7 def response @response end |
Instance Method Details
#result ⇒ Object
14 15 16 17 18 19 20 |
# File 'lib/turnstile/verification.rb', line 14 def result @result ||= begin response = perform_verification Hashie::Mash.new(response.body) end end |
#success? ⇒ Boolean
22 23 24 |
# File 'lib/turnstile/verification.rb', line 22 def success? result.success? end |