Class: Fog::Compute::GoGrid::Password
- Inherits:
-
Model
- Object
- Model
- Fog::Compute::GoGrid::Password
- Defined in:
- lib/fog/go_grid/models/compute/password.rb
Instance Method Summary collapse
- #destroy ⇒ Object
- #image ⇒ Object
-
#initialize(attributes = {}) ⇒ Password
constructor
A new instance of Password.
- #ready? ⇒ Boolean
- #save ⇒ Object
Constructor Details
#initialize(attributes = {}) ⇒ Password
Returns a new instance of Password.
16 17 18 |
# File 'lib/fog/go_grid/models/compute/password.rb', line 16 def initialize(attributes={}) super end |
Instance Method Details
#destroy ⇒ Object
20 21 22 23 24 |
# File 'lib/fog/go_grid/models/compute/password.rb', line 20 def destroy requires :id service.grid_server_destroy(id) true end |
#image ⇒ Object
26 27 28 29 |
# File 'lib/fog/go_grid/models/compute/password.rb', line 26 def image requires :image_id service.grid_image_get(image_id) end |
#ready? ⇒ Boolean
31 32 33 |
# File 'lib/fog/go_grid/models/compute/password.rb', line 31 def ready? @state == 'On' end |
#save ⇒ Object
35 36 37 38 39 40 41 |
# File 'lib/fog/go_grid/models/compute/password.rb', line 35 def save raise Fog::Errors::Error.new('Resaving an existing object may create a duplicate') if persisted? requires :password_id data = service.support_password_list() merge_attributes(data.body) true end |