Class: Fog::Scaleway::Account::User

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

Instance Method Summary collapse

Instance Method Details

#organizations=(value) ⇒ Object



18
19
20
21
22
23
24
25
26
27
28
29
# File 'lib/fog/scaleway/models/account/user.rb', line 18

def organizations=(value)
  attributes[:organizations] = value.map do |v|
    case v
    when Hash
      service.organizations.new(v)
    when String
      service.organizations.new(identity: v)
    else
      v
    end
  end
end

#saveObject



31
32
33
34
35
36
37
# File 'lib/fog/scaleway/models/account/user.rb', line 31

def save
  if persisted?
    update
  else
    create
  end
end