Class: Fog::Compute::ProfitBricks::User
- Inherits:
-
Models::ProfitBricks::Base
- Object
- Model
- Models::ProfitBricks::Base
- Fog::Compute::ProfitBricks::User
- Includes:
- Helpers::ProfitBricks::DataHelper
- Defined in:
- lib/fog/profitbricks/models/compute/user.rb
Instance Attribute Summary collapse
-
#options ⇒ Object
Returns the value of attribute options.
Instance Method Summary collapse
- #delete ⇒ Object
-
#initialize(attributes = {}) ⇒ User
constructor
A new instance of User.
- #save ⇒ Object
- #update ⇒ Object
Methods included from Helpers::ProfitBricks::DataHelper
Methods inherited from Models::ProfitBricks::Base
#failed?, #ready?, #request_status, #wait_for
Constructor Details
#initialize(attributes = {}) ⇒ User
Returns a new instance of User.
34 35 36 |
# File 'lib/fog/profitbricks/models/compute/user.rb', line 34 def initialize(attributes = {}) super end |
Instance Attribute Details
#options ⇒ Object
Returns the value of attribute options.
32 33 34 |
# File 'lib/fog/profitbricks/models/compute/user.rb', line 32 def @options end |
Instance Method Details
#delete ⇒ Object
70 71 72 73 74 |
# File 'lib/fog/profitbricks/models/compute/user.rb', line 70 def delete requires :id service.delete_user(id) true end |
#save ⇒ Object
38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 |
# File 'lib/fog/profitbricks/models/compute/user.rb', line 38 def save requires :firstname, :lastname, :email, :password = {} [:firstname] = firstname [:lastname] = lastname [:email] = email [:password] = password [:administrator] = administrator if administrator [:forceSecAuth] = force_sec_auth if force_sec_auth data = service.create_user() merge_attributes(flatten(data.body)) true end |
#update ⇒ Object
55 56 57 58 59 60 61 62 63 64 65 66 67 68 |
# File 'lib/fog/profitbricks/models/compute/user.rb', line 55 def update requires :id, :firstname, :lastname, :email, :administrator, :force_sec_auth = {} [:firstname] = firstname [:lastname] = lastname [:email] = email [:administrator] = administrator [:forceSecAuth] = force_sec_auth data = service.update_user(id, ) merge_attributes(flatten(data.body)) true end |