Class: OpenMarket::CarrierLookupResponse
- Defined in:
- lib/open_market/response.rb
Instance Attribute Summary collapse
-
#area_code ⇒ Object
readonly
Returns the value of attribute area_code.
-
#area_code_length ⇒ Object
readonly
Returns the value of attribute area_code_length.
-
#binary ⇒ Object
readonly
Returns the value of attribute binary.
-
#binary_length ⇒ Object
readonly
Returns the value of attribute binary_length.
-
#carrier_id ⇒ Object
readonly
Returns the value of attribute carrier_id.
-
#city ⇒ Object
readonly
Returns the value of attribute city.
-
#country ⇒ Object
readonly
Returns the value of attribute country.
-
#country_code ⇒ Object
readonly
Returns the value of attribute country_code.
-
#country_name ⇒ Object
readonly
Returns the value of attribute country_name.
-
#digits_all ⇒ Object
readonly
Returns the value of attribute digits_all.
-
#digits_local ⇒ Object
readonly
Returns the value of attribute digits_local.
-
#ems ⇒ Object
readonly
Returns the value of attribute ems.
-
#estimated_latitude ⇒ Object
readonly
Returns the value of attribute estimated_latitude.
-
#estimated_longitude ⇒ Object
readonly
Returns the value of attribute estimated_longitude.
-
#intl_notation ⇒ Object
readonly
Returns the value of attribute intl_notation.
-
#local_format ⇒ Object
readonly
Returns the value of attribute local_format.
-
#local_notation ⇒ Object
readonly
Returns the value of attribute local_notation.
-
#na_line ⇒ Object
readonly
Returns the value of attribute na_line.
-
#na_nxx ⇒ Object
readonly
Returns the value of attribute na_nxx.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#national_number ⇒ Object
readonly
Returns the value of attribute national_number.
-
#num_max_length ⇒ Object
readonly
Returns the value of attribute num_max_length.
-
#num_min_length ⇒ Object
readonly
Returns the value of attribute num_min_length.
-
#ported ⇒ Object
readonly
Returns the value of attribute ported.
-
#ported_from ⇒ Object
readonly
Returns the value of attribute ported_from.
-
#region ⇒ Object
readonly
Returns the value of attribute region.
-
#region_name ⇒ Object
readonly
Returns the value of attribute region_name.
-
#smart_messaging ⇒ Object
readonly
Returns the value of attribute smart_messaging.
-
#text_length ⇒ Object
readonly
Returns the value of attribute text_length.
-
#timezone_max ⇒ Object
readonly
Returns the value of attribute timezone_max.
-
#timezone_min ⇒ Object
readonly
Returns the value of attribute timezone_min.
-
#unicode ⇒ Object
readonly
Returns the value of attribute unicode.
-
#unicode_length ⇒ Object
readonly
Returns the value of attribute unicode_length.
-
#wap_push ⇒ Object
readonly
Returns the value of attribute wap_push.
-
#zone ⇒ Object
readonly
Returns the value of attribute zone.
-
#zone_name ⇒ Object
readonly
Returns the value of attribute zone_name.
Attributes inherited from Response
Instance Method Summary collapse
-
#initialize(http_response) ⇒ CarrierLookupResponse
constructor
A new instance of CarrierLookupResponse.
Constructor Details
#initialize(http_response) ⇒ CarrierLookupResponse
Returns a new instance of CarrierLookupResponse.
30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 |
# File 'lib/open_market/response.rb', line 30 def initialize(http_response) super if destination = xml.elements["destination"] @country_code = destination.attributes["country_code"].to_i @national_number = destination.attributes["national_number"] @intl_notation = destination.attributes["intl_notation"] @area_code = destination.attributes["area_code"] @area_code_length = destination.attributes["area_code_length"].to_i @num_min_length = destination.attributes["num_min_length"].to_i @num_max_length = destination.attributes["num_max_length"].to_i @na_nxx = destination.attributes["na_nxx"] @na_line = destination.attributes["na_line"] @local_notation = destination.attributes["local_notation"] @local_format = destination.attributes["local_format"] @digits_all = destination.attributes["digits_all"].to_i @digits_local = destination.attributes["digits_local"].to_i @ported = destination.attributes["ported"] == "true" @ported_from = destination.attributes["ported_from"] end if location = xml.elements["location"] @city = location.attributes["city"] @country = location.attributes["country"] @country_name = location.attributes["country_name"] @estimated_latitude = location.attributes["estimated_latitude"].to_f @estimated_longitude = location.attributes["estimated_longitude"].to_f @region = location.attributes["region"] @region_name = location.attributes["region_name"] @timezone_min = location.attributes["timezone_min"].to_i @timezone_max= location.attributes["timezone_max"].to_i @zone = location.attributes["zone"].to_i @zone_name = location.attributes["zone_name"] end if operator = xml.elements["operator"] @carrier_id = operator.attributes["id"].to_i @name = operator.attributes["name"] @binary_length = operator.attributes["binary_length"].to_i @text_length = operator.attributes["text_length"].to_i @unicode_length = operator.attributes["unicode_length"].to_i @binary = operator.attributes["binary"] == "true" @ems = operator.attributes["ems"] == "true" @smart_messaging = operator.attributes["smart_messaging"] == "true" @unicode = operator.attributes["unicode"] == "true" @wap_push = operator.attributes["wap_push"] == "true" end end |
Instance Attribute Details
#area_code ⇒ Object (readonly)
Returns the value of attribute area_code.
26 27 28 |
# File 'lib/open_market/response.rb', line 26 def area_code @area_code end |
#area_code_length ⇒ Object (readonly)
Returns the value of attribute area_code_length.
26 27 28 |
# File 'lib/open_market/response.rb', line 26 def area_code_length @area_code_length end |
#binary ⇒ Object (readonly)
Returns the value of attribute binary.
28 29 30 |
# File 'lib/open_market/response.rb', line 28 def binary @binary end |
#binary_length ⇒ Object (readonly)
Returns the value of attribute binary_length.
28 29 30 |
# File 'lib/open_market/response.rb', line 28 def binary_length @binary_length end |
#carrier_id ⇒ Object (readonly)
Returns the value of attribute carrier_id.
28 29 30 |
# File 'lib/open_market/response.rb', line 28 def carrier_id @carrier_id end |
#city ⇒ Object (readonly)
Returns the value of attribute city.
27 28 29 |
# File 'lib/open_market/response.rb', line 27 def city @city end |
#country ⇒ Object (readonly)
Returns the value of attribute country.
27 28 29 |
# File 'lib/open_market/response.rb', line 27 def country @country end |
#country_code ⇒ Object (readonly)
Returns the value of attribute country_code.
26 27 28 |
# File 'lib/open_market/response.rb', line 26 def country_code @country_code end |
#country_name ⇒ Object (readonly)
Returns the value of attribute country_name.
27 28 29 |
# File 'lib/open_market/response.rb', line 27 def country_name @country_name end |
#digits_all ⇒ Object (readonly)
Returns the value of attribute digits_all.
26 27 28 |
# File 'lib/open_market/response.rb', line 26 def digits_all @digits_all end |
#digits_local ⇒ Object (readonly)
Returns the value of attribute digits_local.
26 27 28 |
# File 'lib/open_market/response.rb', line 26 def digits_local @digits_local end |
#ems ⇒ Object (readonly)
Returns the value of attribute ems.
28 29 30 |
# File 'lib/open_market/response.rb', line 28 def ems @ems end |
#estimated_latitude ⇒ Object (readonly)
Returns the value of attribute estimated_latitude.
27 28 29 |
# File 'lib/open_market/response.rb', line 27 def estimated_latitude @estimated_latitude end |
#estimated_longitude ⇒ Object (readonly)
Returns the value of attribute estimated_longitude.
27 28 29 |
# File 'lib/open_market/response.rb', line 27 def estimated_longitude @estimated_longitude end |
#intl_notation ⇒ Object (readonly)
Returns the value of attribute intl_notation.
26 27 28 |
# File 'lib/open_market/response.rb', line 26 def intl_notation @intl_notation end |
#local_format ⇒ Object (readonly)
Returns the value of attribute local_format.
26 27 28 |
# File 'lib/open_market/response.rb', line 26 def local_format @local_format end |
#local_notation ⇒ Object (readonly)
Returns the value of attribute local_notation.
26 27 28 |
# File 'lib/open_market/response.rb', line 26 def local_notation @local_notation end |
#na_line ⇒ Object (readonly)
Returns the value of attribute na_line.
26 27 28 |
# File 'lib/open_market/response.rb', line 26 def na_line @na_line end |
#na_nxx ⇒ Object (readonly)
Returns the value of attribute na_nxx.
26 27 28 |
# File 'lib/open_market/response.rb', line 26 def na_nxx @na_nxx end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
28 29 30 |
# File 'lib/open_market/response.rb', line 28 def name @name end |
#national_number ⇒ Object (readonly)
Returns the value of attribute national_number.
26 27 28 |
# File 'lib/open_market/response.rb', line 26 def national_number @national_number end |
#num_max_length ⇒ Object (readonly)
Returns the value of attribute num_max_length.
26 27 28 |
# File 'lib/open_market/response.rb', line 26 def num_max_length @num_max_length end |
#num_min_length ⇒ Object (readonly)
Returns the value of attribute num_min_length.
26 27 28 |
# File 'lib/open_market/response.rb', line 26 def num_min_length @num_min_length end |
#ported ⇒ Object (readonly)
Returns the value of attribute ported.
26 27 28 |
# File 'lib/open_market/response.rb', line 26 def ported @ported end |
#ported_from ⇒ Object (readonly)
Returns the value of attribute ported_from.
26 27 28 |
# File 'lib/open_market/response.rb', line 26 def ported_from @ported_from end |
#region ⇒ Object (readonly)
Returns the value of attribute region.
27 28 29 |
# File 'lib/open_market/response.rb', line 27 def region @region end |
#region_name ⇒ Object (readonly)
Returns the value of attribute region_name.
27 28 29 |
# File 'lib/open_market/response.rb', line 27 def region_name @region_name end |
#smart_messaging ⇒ Object (readonly)
Returns the value of attribute smart_messaging.
28 29 30 |
# File 'lib/open_market/response.rb', line 28 def smart_messaging @smart_messaging end |
#text_length ⇒ Object (readonly)
Returns the value of attribute text_length.
28 29 30 |
# File 'lib/open_market/response.rb', line 28 def text_length @text_length end |
#timezone_max ⇒ Object (readonly)
Returns the value of attribute timezone_max.
27 28 29 |
# File 'lib/open_market/response.rb', line 27 def timezone_max @timezone_max end |
#timezone_min ⇒ Object (readonly)
Returns the value of attribute timezone_min.
27 28 29 |
# File 'lib/open_market/response.rb', line 27 def timezone_min @timezone_min end |
#unicode ⇒ Object (readonly)
Returns the value of attribute unicode.
28 29 30 |
# File 'lib/open_market/response.rb', line 28 def unicode @unicode end |
#unicode_length ⇒ Object (readonly)
Returns the value of attribute unicode_length.
28 29 30 |
# File 'lib/open_market/response.rb', line 28 def unicode_length @unicode_length end |
#wap_push ⇒ Object (readonly)
Returns the value of attribute wap_push.
28 29 30 |
# File 'lib/open_market/response.rb', line 28 def wap_push @wap_push end |
#zone ⇒ Object (readonly)
Returns the value of attribute zone.
27 28 29 |
# File 'lib/open_market/response.rb', line 27 def zone @zone end |
#zone_name ⇒ Object (readonly)
Returns the value of attribute zone_name.
27 28 29 |
# File 'lib/open_market/response.rb', line 27 def zone_name @zone_name end |