Class: RingCaptcha::RingCaptchaVerification
- Inherits:
-
Object
- Object
- RingCaptcha::RingCaptchaVerification
- Extended by:
- Forwardable
- Defined in:
- lib/ringcaptcha.rb
Constant Summary collapse
- PUBLIC_METHODS =
[:status, :message, :transaction_id, :phone_number, :geolocation, :phone_type, :carrier_name, :roaming, :risk, :json]
Instance Method Summary collapse
- #as_json(options = {}) ⇒ Object
-
#initialize(json) ⇒ RingCaptchaVerification
constructor
A new instance of RingCaptchaVerification.
- #valid? ⇒ Boolean
Constructor Details
#initialize(json) ⇒ RingCaptchaVerification
Returns a new instance of RingCaptchaVerification.
17 18 19 |
# File 'lib/ringcaptcha.rb', line 17 def initialize(json) @json = json end |
Instance Method Details
#as_json(options = {}) ⇒ Object
25 26 27 |
# File 'lib/ringcaptcha.rb', line 25 def as_json(={}) @json.slice(*PUBLIC_METHODS.map(&:to_s)) end |
#valid? ⇒ Boolean
21 22 23 |
# File 'lib/ringcaptcha.rb', line 21 def valid? @status == "SUCCESS" end |