Class: Fog::Compute::GoGrid::Password

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

Instance Attribute Summary

Attributes inherited from Model

#collection, #connection

Instance Method Summary collapse

Methods inherited from Model

#inspect, #reload, #symbolize_keys, #to_json, #wait_for

Methods included from Attributes::ClassMethods

#_load, #aliases, #attribute, #attributes, #identity, #ignore_attributes, #ignored_attributes

Methods included from Attributes::InstanceMethods

#_dump, #attributes, #dup, #identity, #identity=, #merge_attributes, #new_record?, #requires, #requires_one

Constructor Details

#initialize(attributes = {}) ⇒ Password

Returns a new instance of Password.



18
19
20
# File 'lib/fog/go_grid/models/compute/password.rb', line 18

def initialize(attributes={})
  super
end

Instance Method Details

#destroyObject



22
23
24
25
26
# File 'lib/fog/go_grid/models/compute/password.rb', line 22

def destroy
  requires :id
  connection.grid_server_destroy(id)
  true
end

#imageObject



28
29
30
31
# File 'lib/fog/go_grid/models/compute/password.rb', line 28

def image
  requires :image_id
  connection.grid_image_get(image_id)
end

#ready?Boolean

Returns:

  • (Boolean)


33
34
35
# File 'lib/fog/go_grid/models/compute/password.rb', line 33

def ready?
  @state == 'On'
end

#saveObject

Raises:



37
38
39
40
41
42
43
# File 'lib/fog/go_grid/models/compute/password.rb', line 37

def save
  raise Fog::Errors::Error.new('Resaving an existing object may create a duplicate') if identity
  requires :password_id
  data = connection.support_password_list()
  merge_attributes(data.body)
  true
end