class Beaver::Phone
Phone
Model.
Attributes
country_code[RW]
TODO: Write general description for this method @return [String]
phone_number[RW]
TODO: Write general description for this method @return [String]
type[RW]
TODO: Write general description for this method @return [TypeEnum]
Public Class Methods
from_hash(hash)
click to toggle source
Creates an instance of the object from a hash.
# File lib/beaver/models/phone.rb, line 39 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'] # Create object from extracted values. Phone.new(country_code, phone_number, type) end
names()
click to toggle source
A mapping from model property names to API property names.
# File lib/beaver/models/phone.rb, line 22 def self.names @_hash = {} if @_hash.nil? @_hash['country_code'] = 'country_code' @_hash['phone_number'] = 'phone_number' @_hash['type'] = 'type' @_hash end
new(country_code = nil, phone_number = nil, type = nil)
click to toggle source
# File lib/beaver/models/phone.rb, line 30 def initialize(country_code = nil, phone_number = nil, type = nil) @country_code = country_code @phone_number = phone_number @type = type end