Class: Ridley::DataBag

Inherits:
Object
  • Object
show all
Includes:
Resource
Defined in:
lib/ridley/resources/data_bag.rb

Overview

Author:

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Resource

#<=>, #==, #attribute, #attribute=, #attribute?, #attributes, #attributes=, #chef_id, #eql?, #from_hash, #from_json, #hash, #initialize, #reload, #save, #to_hash, #to_json, #to_s

Class Method Details

.find(connection, object) ⇒ nil, Ridley::DataBag

Parameters:

Returns:



36
37
38
39
40
# File 'lib/ridley/resources/data_bag.rb', line 36

def find(connection, object)
  find!(connection, object)
rescue Errors::HTTPNotFound
  nil
end

.find!(connection, object) ⇒ Ridley::DataBag

Parameters:

Returns:

Raises:



49
50
51
52
53
# File 'lib/ridley/resources/data_bag.rb', line 49

def find!(connection, object)
  chef_id = object.respond_to?(:chef_id) ? object.chef_id : object
  connection.get("#{self.resource_path}/#{chef_id}")
  new(connection, name: chef_id)
end

Instance Method Details

#encrypted_itemObject



66
67
68
# File 'lib/ridley/resources/data_bag.rb', line 66

def encrypted_item
  DBIChainLink.new(self, connection, encrypted: true)
end

#itemObject



62
63
64
# File 'lib/ridley/resources/data_bag.rb', line 62

def item
  DBIChainLink.new(self, connection)
end