Class: MessageMediaLookups::LookupAPhoneNumberResponse
- Defined in:
- lib/message_media_lookups/models/lookup_a_phone_number_response.rb
Overview
LookupAPhoneNumberResponse Model.
Instance Attribute Summary collapse
-
#carrier ⇒ Object
TODO: Write general description for this method.
-
#country_code ⇒ String
TODO: Write general description for this method.
-
#phone_number ⇒ String
TODO: Write general description for this method.
-
#type ⇒ String
TODO: Write general description for this method.
Class Method Summary collapse
-
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
-
.names ⇒ Object
A mapping from model property names to API property names.
Instance Method Summary collapse
-
#initialize(country_code = nil, phone_number = nil, type = nil, carrier = nil) ⇒ LookupAPhoneNumberResponse
constructor
A new instance of LookupAPhoneNumberResponse.
Methods inherited from BaseModel
Constructor Details
#initialize(country_code = nil, phone_number = nil, type = nil, carrier = nil) ⇒ LookupAPhoneNumberResponse
Returns a new instance of LookupAPhoneNumberResponse.
31 32 33 34 35 36 37 38 39 |
# File 'lib/message_media_lookups/models/lookup_a_phone_number_response.rb', line 31 def initialize(country_code = nil, phone_number = nil, type = nil, carrier = nil) @country_code = country_code @phone_number = phone_number @type = type @carrier = carrier end |
Instance Attribute Details
#carrier ⇒ Object
TODO: Write general description for this method
19 20 21 |
# File 'lib/message_media_lookups/models/lookup_a_phone_number_response.rb', line 19 def carrier @carrier end |
#country_code ⇒ String
TODO: Write general description for this method
7 8 9 |
# File 'lib/message_media_lookups/models/lookup_a_phone_number_response.rb', line 7 def country_code @country_code end |
#phone_number ⇒ String
TODO: Write general description for this method
11 12 13 |
# File 'lib/message_media_lookups/models/lookup_a_phone_number_response.rb', line 11 def phone_number @phone_number end |
#type ⇒ String
TODO: Write general description for this method
15 16 17 |
# File 'lib/message_media_lookups/models/lookup_a_phone_number_response.rb', line 15 def type @type end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 |
# File 'lib/message_media_lookups/models/lookup_a_phone_number_response.rb', line 42 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. country_code = hash['country_code'] phone_number = hash['phone_number'] type = hash['type'] carrier = hash['carrier'] # Create object from extracted values. LookupAPhoneNumberResponse.new(country_code, phone_number, type, carrier) end |
.names ⇒ Object
A mapping from model property names to API property names.
22 23 24 25 26 27 28 29 |
# File 'lib/message_media_lookups/models/lookup_a_phone_number_response.rb', line 22 def self.names @_hash = {} if @_hash.nil? @_hash['country_code'] = 'country_code' @_hash['phone_number'] = 'phone_number' @_hash['type'] = 'type' @_hash['carrier'] = 'carrier' @_hash end |