Class: Larrow::Qingcloud::KeyPair

Inherits:
Base
  • Object
show all
Defined in:
lib/larrow/qingcloud/key_pair.rb

Constant Summary

Constants inherited from Base

Base::DESTROY_STATUSES

Instance Attribute Summary collapse

Attributes inherited from Base

#delegator, #status

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Base

#conn, conn, describe, destroy_action, #method_missing, #model_name, model_name, #param_by, param_by, plural_name, #show, singular_name, #wait_for

Methods included from Logger

#debug, #err, included, #info

Constructor Details

#initialize(id, name) ⇒ KeyPair

Returns a new instance of KeyPair.



11
12
13
14
# File 'lib/larrow/qingcloud/key_pair.rb', line 11

def initialize id,name
  self.id = id
  self.name = name
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Larrow::Qingcloud::Base

Instance Attribute Details

#idObject

Returns the value of attribute id.



4
5
6
# File 'lib/larrow/qingcloud/key_pair.rb', line 4

def id
  @id
end

#nameObject

Returns the value of attribute name.



4
5
6
# File 'lib/larrow/qingcloud/key_pair.rb', line 4

def name
  @name
end

Class Method Details

.listObject



5
6
7
8
9
# File 'lib/larrow/qingcloud/key_pair.rb', line 5

def self.list()
  describe([],{}) do |hash|
    new hash['keypair_id'],hash['keypair_name']
  end
end