Class: SmsRu::CallCheckResult

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

Overview

Result of SmsRu::CallCheck#add: the number the user must call to authorize.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Attribute Details

#call_phone ⇒ String (readonly)

Returns the number the user must call.

Returns:

  • (String) —

    the number the user must call



225
226
227
228
229
230
231
232
233
234
235
236
# File 'lib/sms_ru/data.rb', line 225

class CallCheckResult < Data.define(:check_id, :call_phone, :call_phone_pretty, :call_phone_html)
  # @param hash [Hash] the parsed /callcheck/add response
  # @return [SmsRu::CallCheckResult]
  def self.build(hash)
    new(
      check_id: Coerce.string(hash["check_id"]),
      call_phone: Coerce.string(hash["call_phone"]),
      call_phone_pretty: Coerce.string(hash["call_phone_pretty"]),
      call_phone_html: Coerce.string(hash["call_phone_html"])
    )
  end
end

#call_phone_html ⇒ String (readonly)

Returns a mobile-clickable tel: link for the number.

Returns:

  • (String) —

    a mobile-clickable tel: link for the number



225
226
227
228
229
230
231
232
233
234
235
236
# File 'lib/sms_ru/data.rb', line 225

class CallCheckResult < Data.define(:check_id, :call_phone, :call_phone_pretty, :call_phone_html)
  # @param hash [Hash] the parsed /callcheck/add response
  # @return [SmsRu::CallCheckResult]
  def self.build(hash)
    new(
      check_id: Coerce.string(hash["check_id"]),
      call_phone: Coerce.string(hash["call_phone"]),
      call_phone_pretty: Coerce.string(hash["call_phone_pretty"]),
      call_phone_html: Coerce.string(hash["call_phone_html"])
    )
  end
end

#call_phone_pretty ⇒ String (readonly)

Returns the same number, formatted for display.

Returns:

  • (String) —

    the same number, formatted for display



225
226
227
228
229
230
231
232
233
234
235
236
# File 'lib/sms_ru/data.rb', line 225

class CallCheckResult < Data.define(:check_id, :call_phone, :call_phone_pretty, :call_phone_html)
  # @param hash [Hash] the parsed /callcheck/add response
  # @return [SmsRu::CallCheckResult]
  def self.build(hash)
    new(
      check_id: Coerce.string(hash["check_id"]),
      call_phone: Coerce.string(hash["call_phone"]),
      call_phone_pretty: Coerce.string(hash["call_phone_pretty"]),
      call_phone_html: Coerce.string(hash["call_phone_html"])
    )
  end
end

#check_id ⇒ String (readonly)

Returns the check id to poll with SmsRu::CallCheck#status.

Returns:

  • (String) —

    the check id to poll with SmsRu::CallCheck#status



225
226
227
228
229
230
231
232
233
234
235
236
# File 'lib/sms_ru/data.rb', line 225

class CallCheckResult < Data.define(:check_id, :call_phone, :call_phone_pretty, :call_phone_html)
  # @param hash [Hash] the parsed /callcheck/add response
  # @return [SmsRu::CallCheckResult]
  def self.build(hash)
    new(
      check_id: Coerce.string(hash["check_id"]),
      call_phone: Coerce.string(hash["call_phone"]),
      call_phone_pretty: Coerce.string(hash["call_phone_pretty"]),
      call_phone_html: Coerce.string(hash["call_phone_html"])
    )
  end
end

Class Method Details

.build(hash) ⇒ SmsRu::CallCheckResult

Parameters:

  • hash (Hash) —

    the parsed /callcheck/add response

Returns:



228
229
230
231
232
233
234
235
# File 'lib/sms_ru/data.rb', line 228

def self.build(hash)
  new(
    check_id: Coerce.string(hash["check_id"]),
    call_phone: Coerce.string(hash["call_phone"]),
    call_phone_pretty: Coerce.string(hash["call_phone_pretty"]),
    call_phone_html: Coerce.string(hash["call_phone_html"])
  )
end