Class: Postio::Models::PhoneResult
- Inherits:
-
Data
- Object
- Data
- Postio::Models::PhoneResult
- Defined in:
- lib/postio/models.rb
Overview
PhoneResult — validation verdict for one phone number.
SPEC DRIFT (2026-05-02): the OpenAPI spec marks every nullable field as required, but on invalid input the live API drops them entirely. The .from_hash fetcher uses h which returns nil for missing keys, papering over the drift. Also: spec says is_reachable is string|null, but the live API returns bool — we accept either.
Instance Attribute Summary collapse
-
#country_code ⇒ Object
readonly
Returns the value of attribute country_code.
-
#country_name ⇒ Object
readonly
Returns the value of attribute country_name.
-
#current_carrier ⇒ Object
readonly
Returns the value of attribute current_carrier.
-
#e164_format ⇒ Object
readonly
Returns the value of attribute e164_format.
-
#international_format ⇒ Object
readonly
Returns the value of attribute international_format.
-
#is_ported ⇒ Object
readonly
Returns the value of attribute is_ported.
-
#is_possible ⇒ Object
readonly
Returns the value of attribute is_possible.
-
#is_reachable ⇒ Object
readonly
Returns the value of attribute is_reachable.
-
#is_valid ⇒ Object
readonly
Returns the value of attribute is_valid.
-
#level ⇒ Object
readonly
Returns the value of attribute level.
-
#lookup_error ⇒ Object
readonly
Returns the value of attribute lookup_error.
-
#mcc ⇒ Object
readonly
Returns the value of attribute mcc.
-
#mnc ⇒ Object
readonly
Returns the value of attribute mnc.
-
#national_format ⇒ Object
readonly
Returns the value of attribute national_format.
-
#number ⇒ Object
readonly
Returns the value of attribute number.
-
#original_carrier ⇒ Object
readonly
Returns the value of attribute original_carrier.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Class Method Summary collapse
Instance Attribute Details
#country_code ⇒ Object (readonly)
Returns the value of attribute country_code
119 120 121 |
# File 'lib/postio/models.rb', line 119 def country_code @country_code end |
#country_name ⇒ Object (readonly)
Returns the value of attribute country_name
119 120 121 |
# File 'lib/postio/models.rb', line 119 def country_name @country_name end |
#current_carrier ⇒ Object (readonly)
Returns the value of attribute current_carrier
119 120 121 |
# File 'lib/postio/models.rb', line 119 def current_carrier @current_carrier end |
#e164_format ⇒ Object (readonly)
Returns the value of attribute e164_format
119 120 121 |
# File 'lib/postio/models.rb', line 119 def e164_format @e164_format end |
#international_format ⇒ Object (readonly)
Returns the value of attribute international_format
119 120 121 |
# File 'lib/postio/models.rb', line 119 def international_format @international_format end |
#is_ported ⇒ Object (readonly)
Returns the value of attribute is_ported
119 120 121 |
# File 'lib/postio/models.rb', line 119 def is_ported @is_ported end |
#is_possible ⇒ Object (readonly)
Returns the value of attribute is_possible
119 120 121 |
# File 'lib/postio/models.rb', line 119 def is_possible @is_possible end |
#is_reachable ⇒ Object (readonly)
Returns the value of attribute is_reachable
119 120 121 |
# File 'lib/postio/models.rb', line 119 def is_reachable @is_reachable end |
#is_valid ⇒ Object (readonly)
Returns the value of attribute is_valid
119 120 121 |
# File 'lib/postio/models.rb', line 119 def is_valid @is_valid end |
#level ⇒ Object (readonly)
Returns the value of attribute level
119 120 121 |
# File 'lib/postio/models.rb', line 119 def level @level end |
#lookup_error ⇒ Object (readonly)
Returns the value of attribute lookup_error
119 120 121 |
# File 'lib/postio/models.rb', line 119 def lookup_error @lookup_error end |
#mcc ⇒ Object (readonly)
Returns the value of attribute mcc
119 120 121 |
# File 'lib/postio/models.rb', line 119 def mcc @mcc end |
#mnc ⇒ Object (readonly)
Returns the value of attribute mnc
119 120 121 |
# File 'lib/postio/models.rb', line 119 def mnc @mnc end |
#national_format ⇒ Object (readonly)
Returns the value of attribute national_format
119 120 121 |
# File 'lib/postio/models.rb', line 119 def national_format @national_format end |
#number ⇒ Object (readonly)
Returns the value of attribute number
119 120 121 |
# File 'lib/postio/models.rb', line 119 def number @number end |
#original_carrier ⇒ Object (readonly)
Returns the value of attribute original_carrier
119 120 121 |
# File 'lib/postio/models.rb', line 119 def original_carrier @original_carrier end |
#type ⇒ Object (readonly)
Returns the value of attribute type
119 120 121 |
# File 'lib/postio/models.rb', line 119 def type @type end |
Class Method Details
.from_hash(h) ⇒ Object
124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 |
# File 'lib/postio/models.rb', line 124 def self.from_hash(h) new( number: h["number"].to_s, is_valid: h["isValid"] == true, is_possible: h["isPossible"] == true, type: h["type"], country_code: h["countryCode"], country_name: h["countryName"], national_format: h["nationalFormat"], international_format: h["internationalFormat"], e164_format: h["e164Format"], original_carrier: h["originalCarrier"], current_carrier: h["currentCarrier"], is_ported: h["isPorted"], is_reachable: h["isReachable"], mcc: h["mcc"], mnc: h["mnc"], level: h["level"], lookup_error: h["lookupError"] ) end |