Class: MundiApi::CreatePhoneRequest
- Defined in:
- lib/mundi_api/models/create_phone_request.rb
Overview
CreatePhoneRequest Model.
Instance Attribute Summary collapse
-
#area_code ⇒ String
TODO: Write general description for this method.
-
#country_code ⇒ String
TODO: Write general description for this method.
-
#number ⇒ 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, number = nil, area_code = nil) ⇒ CreatePhoneRequest
constructor
A new instance of CreatePhoneRequest.
Methods inherited from BaseModel
Constructor Details
#initialize(country_code = nil, number = nil, area_code = nil) ⇒ CreatePhoneRequest
Returns a new instance of CreatePhoneRequest.
30 31 32 33 34 35 36 |
# File 'lib/mundi_api/models/create_phone_request.rb', line 30 def initialize(country_code = nil, number = nil, area_code = nil) @country_code = country_code @number = number @area_code = area_code end |
Instance Attribute Details
#area_code ⇒ String
TODO: Write general description for this method
17 18 19 |
# File 'lib/mundi_api/models/create_phone_request.rb', line 17 def area_code @area_code end |
#country_code ⇒ String
TODO: Write general description for this method
9 10 11 |
# File 'lib/mundi_api/models/create_phone_request.rb', line 9 def country_code @country_code end |
#number ⇒ String
TODO: Write general description for this method
13 14 15 |
# File 'lib/mundi_api/models/create_phone_request.rb', line 13 def number @number end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
39 40 41 42 43 44 45 46 47 48 49 50 51 |
# File 'lib/mundi_api/models/create_phone_request.rb', line 39 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. country_code = hash['country_code'] number = hash['number'] area_code = hash['area_code'] # Create object from extracted values. CreatePhoneRequest.new(country_code, number, area_code) end |
.names ⇒ Object
A mapping from model property names to API property names.
20 21 22 23 24 25 26 27 28 |
# File 'lib/mundi_api/models/create_phone_request.rb', line 20 def self.names if @_hash.nil? @_hash = {} @_hash['country_code'] = 'country_code' @_hash['number'] = 'number' @_hash['area_code'] = 'area_code' end @_hash end |