Class: SmsRu::Events::CallcheckStatus
- Inherits:
-
Object
- Object
- SmsRu::Events::CallcheckStatus
- Defined in:
- lib/sms_ru/events.rb
Overview
A call-authorization notification (record type “callcheck_status”).
Instance Attribute Summary collapse
-
#created_at ⇒ Time?
readonly
When SMS.ru created the status.
-
#id ⇒ String
readonly
The check id (the one returned by SmsRu::CallCheck#add).
-
#raw ⇒ Array<String>
readonly
Every line of the original record.
-
#status_code ⇒ Integer?
readonly
The check status code (per /callcheck/status).
Instance Method Summary collapse
-
#confirmed? ⇒ Boolean
True when the user placed the authorizing call (code 401).
-
#expired? ⇒ Boolean
True when the authorization window elapsed (code 402).
-
#type ⇒ String
The wire record type.
Instance Attribute Details
#created_at ⇒ Time? (readonly)
Returns when SMS.ru created the status.
34 35 36 37 38 39 40 41 42 43 |
# File 'lib/sms_ru/events.rb', line 34 class CallcheckStatus < Data.define(:id, :status_code, :created_at, :raw) # @return [String] the wire record type def type = "callcheck_status" # @return [Boolean] true when the user placed the authorizing call (code 401) def confirmed? = status_code == 401 # @return [Boolean] true when the authorization window elapsed (code 402) def expired? = status_code == 402 end |
#id ⇒ String (readonly)
Returns the check id (the one returned by SmsRu::CallCheck#add).
34 35 36 37 38 39 40 41 42 43 |
# File 'lib/sms_ru/events.rb', line 34 class CallcheckStatus < Data.define(:id, :status_code, :created_at, :raw) # @return [String] the wire record type def type = "callcheck_status" # @return [Boolean] true when the user placed the authorizing call (code 401) def confirmed? = status_code == 401 # @return [Boolean] true when the authorization window elapsed (code 402) def expired? = status_code == 402 end |
#raw ⇒ Array<String> (readonly)
Returns every line of the original record.
34 35 36 37 38 39 40 41 42 43 |
# File 'lib/sms_ru/events.rb', line 34 class CallcheckStatus < Data.define(:id, :status_code, :created_at, :raw) # @return [String] the wire record type def type = "callcheck_status" # @return [Boolean] true when the user placed the authorizing call (code 401) def confirmed? = status_code == 401 # @return [Boolean] true when the authorization window elapsed (code 402) def expired? = status_code == 402 end |
#status_code ⇒ Integer? (readonly)
Returns the check status code (per /callcheck/status).
34 35 36 37 38 39 40 41 42 43 |
# File 'lib/sms_ru/events.rb', line 34 class CallcheckStatus < Data.define(:id, :status_code, :created_at, :raw) # @return [String] the wire record type def type = "callcheck_status" # @return [Boolean] true when the user placed the authorizing call (code 401) def confirmed? = status_code == 401 # @return [Boolean] true when the authorization window elapsed (code 402) def expired? = status_code == 402 end |
Instance Method Details
#confirmed? ⇒ Boolean
Returns true when the user placed the authorizing call (code 401).
39 |
# File 'lib/sms_ru/events.rb', line 39 def confirmed? = status_code == 401 |
#expired? ⇒ Boolean
Returns true when the authorization window elapsed (code 402).
42 |
# File 'lib/sms_ru/events.rb', line 42 def expired? = status_code == 402 |
#type ⇒ String
Returns the wire record type.
36 |
# File 'lib/sms_ru/events.rb', line 36 def type = "callcheck_status" |