Class: SmsRu::CallCheckResult
- Inherits:
-
Object
- Object
- SmsRu::CallCheckResult
- 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
-
#call_phone ⇒ String
readonly
The number the user must call.
-
#call_phone_html ⇒ String
readonly
A mobile-clickable ‘tel:` link for the number.
-
#call_phone_pretty ⇒ String
readonly
The same number, formatted for display.
-
#check_id ⇒ String
readonly
The check id to poll with SmsRu::CallCheck#status.
Class Method Summary collapse
Instance Attribute Details
#call_phone ⇒ String (readonly)
Returns 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.
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.
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.
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
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 |