Method: VoucherifySdk::User#initialize

Defined in:
lib/VoucherifySdk/models/user.rb

#initialize(attributes = {}) ⇒ User

Initializes the object



86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
# File 'lib/VoucherifySdk/models/user.rb', line 86

def initialize(attributes = {})
  # check to see if the attribute exists and convert string to symbol for hash key
  attributes = attributes.each_with_object({}) { |(k, v), h|
    h[k.to_sym] = v
  }

  if attributes.key?(:'id')
    self.id = attributes[:'id']
  end

  if attributes.key?(:'login')
    self. = attributes[:'login']
  end

  if attributes.key?(:'email')
    self.email = attributes[:'email']
  end

  if attributes.key?(:'first_name')
    self.first_name = attributes[:'first_name']
  end

  if attributes.key?(:'last_name')
    self.last_name = attributes[:'last_name']
  end

  if attributes.key?(:'projects')
    if (value = attributes[:'projects']).is_a?(Hash)
      self.projects = value
    end
  end

  if attributes.key?(:'is_owner')
    self.is_owner = attributes[:'is_owner']
  end
end