class Ridley::UserObject

Public Instance Methods

authenticate(password) click to toggle source
# File lib/ridley/chef_objects/user_object.rb, line 43
def authenticate(password)
  @resource.authenticate(self.chef_id, password)
end
regenerate_key() click to toggle source

Regenerates the private key of the instantiated user object. The new private key will be set to the value of the 'private_key' accessor of the instantiated user object.

@return [Boolean]

true for success and false for failure
# File lib/ridley/chef_objects/user_object.rb, line 38
def regenerate_key
  self.private_key = true
  self.save
end
to_json() click to toggle source

Override to_json to reflect to massage the returned attributes based on the type of connection. Only OHC/OPC requires the json_class attribute is not present.

Calls superclass method
# File lib/ridley/chef_objects/user_object.rb, line 49
def to_json
  if resource.connection.hosted?
    to_hash.except(:json_class).to_json
  else
    super
  end
end