Sha256: e6e68a18a4981bc632eea978f13c9e4c555b6d0e81333aeaeac233dfab9de500

Contents?: true

Size: 806 Bytes

Versions: 11

Compression:

Stored size: 806 Bytes

Contents

module Ridley
  # @author Jamie Winsor <reset@riotgames.com>
  class DataBagObject < ChefObject
    set_chef_id "name"

    attribute :name,
      required: true

    def item
      DataBagItemProxy.new(self, resource.item_resource)
    end

    # @author Jamie Winsor <reset@riotgames.com>
    # @api private
    class DataBagItemProxy
      attr_reader :data_bag_object
      attr_reader :item_resource

      # @param [Ridley::DataBagObject] data_bag_object
      # @param [Ridley::DataBagItemResource] item_resource
      def initialize(data_bag_object, item_resource)
        @data_bag_object = data_bag_object
        @item_resource   = item_resource
      end

      def method_missing(fun, *args, &block)
        @item_resource.send(fun, data_bag_object, *args, &block)
      end
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
ridley-1.0.0.rc2 lib/ridley/chef_objects/data_bag_object.rb
ridley-1.0.0.rc1 lib/ridley/chef_objects/data_bag_object.rb
ridley-0.12.4 lib/ridley/chef_objects/data_bag_object.rb
ridley-0.12.3 lib/ridley/chef_objects/data_bag_object.rb
ridley-0.12.2 lib/ridley/chef_objects/data_bag_object.rb
ridley-0.12.1 lib/ridley/chef_objects/data_bag_object.rb
ridley-0.12.0 lib/ridley/chef_objects/data_bag_object.rb
ridley-0.11.2 lib/ridley/chef_objects/data_bag_object.rb
ridley-0.12.0.rc1 lib/ridley/chef_objects/data_bag_object.rb
ridley-0.11.1 lib/ridley/chef_objects/data_bag_object.rb
ridley-0.11.0.rc1 lib/ridley/chef_objects/data_bag_object.rb