class Fog::Compute::ProfitBricks::User

Attributes

options[RW]

Public Class Methods

new(attributes = {}) click to toggle source
Calls superclass method
# File lib/fog/profitbricks/models/compute/user.rb, line 34
def initialize(attributes = {})
  super
end

Public Instance Methods

delete() click to toggle source
# File lib/fog/profitbricks/models/compute/user.rb, line 70
def delete
  requires :id
  service.delete_user(id)
  true
end
save() click to toggle source
# File lib/fog/profitbricks/models/compute/user.rb, line 38
def save
  requires :firstname, :lastname, :email, :password

  options = {}

  options[:firstname]     = firstname
  options[:lastname]      = lastname
  options[:email]         = email
  options[:password]      = password
  options[:administrator] = administrator if administrator
  options[:forceSecAuth]  = force_sec_auth if force_sec_auth

  data = service.create_user(options)
  merge_attributes(flatten(data.body))
  true
end
update() click to toggle source
# File lib/fog/profitbricks/models/compute/user.rb, line 55
def update
  requires :id, :firstname, :lastname, :email, :administrator, :force_sec_auth

  options = {}
  options[:firstname]     = firstname
  options[:lastname]      = lastname
  options[:email]         = email
  options[:administrator] = administrator
  options[:forceSecAuth]  = force_sec_auth

  data = service.update_user(id, options)
  merge_attributes(flatten(data.body))
  true
end