Class: Fog::Compute::Packet::User

Inherits:
Model
  • Object
show all
Defined in:
lib/fog/compute/packet/models/user.rb

Overview

User

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ User

Returns a new instance of User.



34
35
36
# File 'lib/fog/compute/packet/models/user.rb', line 34

def initialize(attributes = {})
  super
end

Instance Attribute Details

#optionsObject

Returns the value of attribute options.



32
33
34
# File 'lib/fog/compute/packet/models/user.rb', line 32

def options
  @options
end

Instance Method Details

#updateObject



38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
# File 'lib/fog/compute/packet/models/user.rb', line 38

def update
  requires :id

  options = {}
  options[:first_name] = first_name if first_name
  options[:last_name] = last_name if last_name
  options[:phone_number] = phone_number if phone_number
  options[:timezone] = timezone if timezone
  options[:password] = password if password
  options[:avatar] = avatar if avatar

  response = service.update_user(id, options)

  merge_attributes(response.body)
end