Class: SmsRu::CallCheckStatus
- Inherits:
-
Object
- Object
- SmsRu::CallCheckStatus
- Defined in:
- lib/sms_ru/data.rb
Overview
Result of SmsRu::CallCheck#status — whether the authorizing call has arrived.
Instance Attribute Summary collapse
-
#status_code ⇒ Integer
readonly
The check status code (401 once confirmed).
-
#status_text ⇒ String
readonly
The human-readable status.
Class Method Summary collapse
Instance Method Summary collapse
-
#confirmed? ⇒ Boolean
True once the user has placed the authorizing call.
Instance Attribute Details
#status_code ⇒ Integer (readonly)
Returns the check status code (401 once confirmed).
244 245 246 247 248 249 250 251 252 253 |
# File 'lib/sms_ru/data.rb', line 244 class CallCheckStatus < Data.define(:status_code, :status_text) # @param hash [Hash] the parsed /callcheck/status response # @return [SmsRu::CallCheckStatus] def self.build(hash) new(status_code: Coerce.integer(hash["check_status"]), status_text: Coerce.string(hash["check_status_text"])) end # @return [Boolean] true once the user has placed the authorizing call def confirmed? = status_code == 401 end |
#status_text ⇒ String (readonly)
Returns the human-readable status.
244 245 246 247 248 249 250 251 252 253 |
# File 'lib/sms_ru/data.rb', line 244 class CallCheckStatus < Data.define(:status_code, :status_text) # @param hash [Hash] the parsed /callcheck/status response # @return [SmsRu::CallCheckStatus] def self.build(hash) new(status_code: Coerce.integer(hash["check_status"]), status_text: Coerce.string(hash["check_status_text"])) end # @return [Boolean] true once the user has placed the authorizing call def confirmed? = status_code == 401 end |
Class Method Details
.build(hash) ⇒ SmsRu::CallCheckStatus
247 248 249 |
# File 'lib/sms_ru/data.rb', line 247 def self.build(hash) new(status_code: Coerce.integer(hash["check_status"]), status_text: Coerce.string(hash["check_status_text"])) end |
Instance Method Details
#confirmed? ⇒ Boolean
Returns true once the user has placed the authorizing call.
252 |
# File 'lib/sms_ru/data.rb', line 252 def confirmed? = status_code == 401 |