Class: Postio::Models::PhoneResult

Inherits:
Data
  • Object
show all
Defined in:
lib/postio/models.rb

Overview

PhoneResult — validation verdict for one phone number.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Attribute Details

#country_codeObject (readonly)

Returns the value of attribute country_code

Returns:

  • (Object)

    the current value of country_code



112
113
114
# File 'lib/postio/models.rb', line 112

def country_code
  @country_code
end

#country_nameObject (readonly)

Returns the value of attribute country_name

Returns:

  • (Object)

    the current value of country_name



112
113
114
# File 'lib/postio/models.rb', line 112

def country_name
  @country_name
end

#current_carrierObject (readonly)

Returns the value of attribute current_carrier

Returns:

  • (Object)

    the current value of current_carrier



112
113
114
# File 'lib/postio/models.rb', line 112

def current_carrier
  @current_carrier
end

#e164_formatObject (readonly)

Returns the value of attribute e164_format

Returns:

  • (Object)

    the current value of e164_format



112
113
114
# File 'lib/postio/models.rb', line 112

def e164_format
  @e164_format
end

#international_formatObject (readonly)

Returns the value of attribute international_format

Returns:

  • (Object)

    the current value of international_format



112
113
114
# File 'lib/postio/models.rb', line 112

def international_format
  @international_format
end

#is_portedObject (readonly)

Returns the value of attribute is_ported

Returns:

  • (Object)

    the current value of is_ported



112
113
114
# File 'lib/postio/models.rb', line 112

def is_ported
  @is_ported
end

#is_possibleObject (readonly)

Returns the value of attribute is_possible

Returns:

  • (Object)

    the current value of is_possible



112
113
114
# File 'lib/postio/models.rb', line 112

def is_possible
  @is_possible
end

#is_reachableObject (readonly)

Returns the value of attribute is_reachable

Returns:

  • (Object)

    the current value of is_reachable



112
113
114
# File 'lib/postio/models.rb', line 112

def is_reachable
  @is_reachable
end

#is_validObject (readonly)

Returns the value of attribute is_valid

Returns:

  • (Object)

    the current value of is_valid



112
113
114
# File 'lib/postio/models.rb', line 112

def is_valid
  @is_valid
end

#levelObject (readonly)

Returns the value of attribute level

Returns:

  • (Object)

    the current value of level



112
113
114
# File 'lib/postio/models.rb', line 112

def level
  @level
end

#lookup_errorObject (readonly)

Returns the value of attribute lookup_error

Returns:

  • (Object)

    the current value of lookup_error



112
113
114
# File 'lib/postio/models.rb', line 112

def lookup_error
  @lookup_error
end

#mccObject (readonly)

Returns the value of attribute mcc

Returns:

  • (Object)

    the current value of mcc



112
113
114
# File 'lib/postio/models.rb', line 112

def mcc
  @mcc
end

#mncObject (readonly)

Returns the value of attribute mnc

Returns:

  • (Object)

    the current value of mnc



112
113
114
# File 'lib/postio/models.rb', line 112

def mnc
  @mnc
end

#national_formatObject (readonly)

Returns the value of attribute national_format

Returns:

  • (Object)

    the current value of national_format



112
113
114
# File 'lib/postio/models.rb', line 112

def national_format
  @national_format
end

#numberObject (readonly)

Returns the value of attribute number

Returns:

  • (Object)

    the current value of number



112
113
114
# File 'lib/postio/models.rb', line 112

def number
  @number
end

#original_carrierObject (readonly)

Returns the value of attribute original_carrier

Returns:

  • (Object)

    the current value of original_carrier



112
113
114
# File 'lib/postio/models.rb', line 112

def original_carrier
  @original_carrier
end

#typeObject (readonly)

Returns the value of attribute type

Returns:

  • (Object)

    the current value of type



112
113
114
# File 'lib/postio/models.rb', line 112

def type
  @type
end

Class Method Details

.from_hash(h) ⇒ Object



117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
# File 'lib/postio/models.rb', line 117

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