Method: PureCloud::Address#initialize
- Defined in:
- lib/purecloud/models/address.rb
#initialize(attributes = {}) ⇒ Address
Returns a new instance of Address.
59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 |
# File 'lib/purecloud/models/address.rb', line 59 def initialize(attributes = {}) return unless attributes.is_a?(Hash) # convert string to symbol for hash key attributes = attributes.inject({}){|memo,(k,v)| memo[k.to_sym] = v; memo} if attributes[:'country'] self.country = attributes[:'country'] end if attributes[:'A1'] self.a1 = attributes[:'A1'] end if attributes[:'A3'] self.a3 = attributes[:'A3'] end if attributes[:'RD'] self.rd = attributes[:'RD'] end if attributes[:'HNO'] self.hno = attributes[:'HNO'] end if attributes[:'LOC'] self.loc = attributes[:'LOC'] end if attributes[:'NAM'] self.nam = attributes[:'NAM'] end if attributes[:'PC'] self.pc = attributes[:'PC'] end end |