Class: Ridley::DataBagResource
- Defined in:
- lib/ridley/resources/data_bag_resource.rb
Instance Attribute Summary collapse
-
#item_resource ⇒ Object
readonly
Returns the value of attribute item_resource.
Instance Method Summary collapse
- #find(object) ⇒ nil, Ridley::DataBagResource
-
#initialize(connection_registry, data_bag_secret) ⇒ DataBagResource
constructor
A new instance of DataBagResource.
Methods inherited from Resource
#all, #connection, #create, #delete, #delete_all, #new, representation, represented_by, resource_path, set_resource_path, #update
Constructor Details
#initialize(connection_registry, data_bag_secret) ⇒ DataBagResource
Returns a new instance of DataBagResource.
14 15 16 17 |
# File 'lib/ridley/resources/data_bag_resource.rb', line 14 def initialize(connection_registry, data_bag_secret) super(connection_registry) @item_resource = DataBagItemResource.new_link(connection_registry, data_bag_secret) end |
Instance Attribute Details
#item_resource ⇒ Object (readonly)
Returns the value of attribute item_resource.
8 9 10 |
# File 'lib/ridley/resources/data_bag_resource.rb', line 8 def item_resource @item_resource end |
Instance Method Details
#find(object) ⇒ nil, Ridley::DataBagResource
22 23 24 25 26 27 28 29 |
# File 'lib/ridley/resources/data_bag_resource.rb', line 22 def find(object) chef_id = object.respond_to?(:chef_id) ? object.chef_id : object request(:get, "#{self.class.resource_path}/#{chef_id}") new(name: chef_id) rescue AbortError => ex return nil if ex.cause.is_a?(Errors::HTTPNotFound) abort(ex.cause) end |