Sha256: 682abbf1837d7f8f516d2623d3ee6a2cfc0b3998a0a2c3680db2553013c5913c

Contents?: true

Size: 425 Bytes

Versions: 515

Compression:

Stored size: 425 Bytes

Contents

class Puppet::Settings::EnumSetting < Puppet::Settings::BaseSetting
  attr_accessor :values

  def type
    :enum
  end

  def munge(value)
    if values.include?(value)
      value
    else
      raise Puppet::Settings::ValidationError,
        _("Invalid value '%{value}' for parameter %{name}. Allowed values are '%{allowed_values}'") % { value: value, name: @name, allowed_values: values.join("', '") }
    end
  end
end

Version data entries

515 entries across 515 versions & 2 rubygems

Version Path
puppet-7.34.0 lib/puppet/settings/enum_setting.rb
puppet-7.34.0-x86-mingw32 lib/puppet/settings/enum_setting.rb
puppet-7.34.0-x64-mingw32 lib/puppet/settings/enum_setting.rb
puppet-7.34.0-universal-darwin lib/puppet/settings/enum_setting.rb
puppet-7.33.0 lib/puppet/settings/enum_setting.rb
puppet-7.33.0-x86-mingw32 lib/puppet/settings/enum_setting.rb
puppet-7.33.0-x64-mingw32 lib/puppet/settings/enum_setting.rb
puppet-7.33.0-universal-darwin lib/puppet/settings/enum_setting.rb
puppet-7.32.1 lib/puppet/settings/enum_setting.rb
puppet-7.32.1-x86-mingw32 lib/puppet/settings/enum_setting.rb
puppet-7.32.1-x64-mingw32 lib/puppet/settings/enum_setting.rb
puppet-7.32.1-universal-darwin lib/puppet/settings/enum_setting.rb
puppet-7.31.0 lib/puppet/settings/enum_setting.rb
puppet-7.31.0-x86-mingw32 lib/puppet/settings/enum_setting.rb
puppet-7.31.0-x64-mingw32 lib/puppet/settings/enum_setting.rb
puppet-7.31.0-universal-darwin lib/puppet/settings/enum_setting.rb
puppet-7.30.0 lib/puppet/settings/enum_setting.rb
puppet-7.30.0-x86-mingw32 lib/puppet/settings/enum_setting.rb
puppet-7.30.0-x64-mingw32 lib/puppet/settings/enum_setting.rb
puppet-7.30.0-universal-darwin lib/puppet/settings/enum_setting.rb