Sha256: cea01d949e7da0b5a08f15c84051799af9047db33ca089d0c20956e0dcc6f04c

Contents?: true

Size: 840 Bytes

Versions: 68

Compression:

Stored size: 840 Bytes

Contents

# A DataAdapter adapts an object with a Hash of data
#
# TODO: API 5.0, remove this class
# @api private
# @deprecated
class Puppet::DataProviders::DataAdapter < Puppet::Pops::Adaptable::Adapter
  include Puppet::Plugins::DataProviders

  attr_accessor :data

  def self.create_adapter(o)
    new
  end

  def initialize
    unless Puppet[:strict] == :off
      Puppet.warn_once(:deprecation, 'Puppet::DataProviders::DataAdapter',
        'Puppet::DataProviders::DataAdapter is deprecated and will be removed in the next major version of Puppet')
    end
    @data = {}
  end

  def [](name)
    @data[name]
  end

  def has_name?(name)
    @data.has_key? name
  end

  def []=(name, value)
    unless value.is_a?(Hash)
      raise ArgumentError, "Given value must be a Hash, got: #{value.class}."
    end
    @data[name] = value
  end
end

Version data entries

68 entries across 68 versions & 2 rubygems

Version Path
puppet-retrospec-1.8.0 vendor/pup410/lib/puppet/data_providers/data_adapter.rb
puppet-retrospec-1.7.0 vendor/pup410/lib/puppet/data_providers/data_adapter.rb
puppet-4.10.12 lib/puppet/data_providers/data_adapter.rb
puppet-4.10.12-x86-mingw32 lib/puppet/data_providers/data_adapter.rb
puppet-4.10.12-x64-mingw32 lib/puppet/data_providers/data_adapter.rb
puppet-4.10.12-universal-darwin lib/puppet/data_providers/data_adapter.rb
puppet-4.10.11 lib/puppet/data_providers/data_adapter.rb
puppet-4.10.11-x86-mingw32 lib/puppet/data_providers/data_adapter.rb
puppet-4.10.11-x64-mingw32 lib/puppet/data_providers/data_adapter.rb
puppet-4.10.11-universal-darwin lib/puppet/data_providers/data_adapter.rb
puppet-4.10.10 lib/puppet/data_providers/data_adapter.rb
puppet-4.10.10-x86-mingw32 lib/puppet/data_providers/data_adapter.rb
puppet-4.10.10-x64-mingw32 lib/puppet/data_providers/data_adapter.rb
puppet-4.10.10-universal-darwin lib/puppet/data_providers/data_adapter.rb
puppet-retrospec-1.6.1 vendor/pup410/lib/puppet/data_providers/data_adapter.rb
puppet-retrospec-1.6.0 vendor/pup410/lib/puppet/data_providers/data_adapter.rb
puppet-4.10.9 lib/puppet/data_providers/data_adapter.rb
puppet-4.10.9-x86-mingw32 lib/puppet/data_providers/data_adapter.rb
puppet-4.10.9-x64-mingw32 lib/puppet/data_providers/data_adapter.rb
puppet-4.10.9-universal-darwin lib/puppet/data_providers/data_adapter.rb