Class: Ridley::Client
- Inherits:
-
Object
- Object
- Ridley::Client
- Includes:
- Resource
- Defined in:
- lib/ridley/resources/client.rb
Overview
Class Method Summary collapse
-
.regenerate_key(connection, client) ⇒ Ridley::Client
Retrieves a client from the remote connection matching the given chef_id and regenerates it’s private key.
Instance Method Summary collapse
- #attributes ⇒ Object
-
#regenerate_key ⇒ Boolean
Regenerates the private key of the instantiated client object.
Methods included from Resource
#<=>, #==, #attribute, #attribute=, #attribute?, #attributes=, #chef_id, #eql?, #from_hash, #from_json, #hash, #initialize, #reload, #save, #to_hash, #to_json, #to_s
Class Method Details
.regenerate_key(connection, client) ⇒ Ridley::Client
Retrieves a client from the remote connection matching the given chef_id and regenerates it’s private key. An instance of the updated object will be returned and have a value set for the ‘private_key’ accessor.
19 20 21 22 23 |
# File 'lib/ridley/resources/client.rb', line 19 def regenerate_key(connection, client) obj = find!(connection, client) obj.regenerate_key obj end |
Instance Method Details
#attributes ⇒ Object
45 46 47 48 49 |
# File 'lib/ridley/resources/client.rb', line 45 def attributes # @todo JW: reflect on the connection type to determine if we need to strip the # json_class attribute. Only OHC/OPC needs this stripped. super.except(:json_class) end |
#regenerate_key ⇒ Boolean
Regenerates the private key of the instantiated client object. The new private key will be set to the value of the ‘private_key’ accessor of the instantiated client object.
57 58 59 60 |
# File 'lib/ridley/resources/client.rb', line 57 def regenerate_key self.private_key = true self.save end |