Class: SmsRu::CallCheckStatus

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

Overview

Result of SmsRu::CallCheck#status — whether the authorizing call has arrived.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#status_codeInteger (readonly)

Returns the check status code (401 once confirmed).

Returns:

  • (Integer)

    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_textString (readonly)

Returns the human-readable status.

Returns:

  • (String)

    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

Parameters:

  • hash (Hash)

    the parsed /callcheck/status response

Returns:



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.

Returns:

  • (Boolean)

    true once the user has placed the authorizing call



252
# File 'lib/sms_ru/data.rb', line 252

def confirmed? = status_code == 401