Class: SmsRu::Events::CallcheckStatus

Inherits:
Object
  • Object
show all
Defined in:
lib/sms_ru/events.rb

Overview

A call-authorization notification (record type "callcheck_status").

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#created_at ⇒ Time? (readonly)

Returns when SMS.ru created the status.

Returns:

  • (Time, nil) —

    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).

Returns:

  • (String) —

    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.

Returns:

  • (Array<String>) —

    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).

Returns:

  • (Integer, nil) —

    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).

Returns:

  • (Boolean) —

    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).

Returns:

  • (Boolean) —

    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.

Returns:

  • (String) —

    the wire record type



36
# File 'lib/sms_ru/events.rb', line 36

def type = "callcheck_status"