Sha256: efad7eff8a8303d7c50e6a7ab3f1c2f9fefbd4fd6ca667521d3e18bde6aaab6f

Contents?: true

Size: 455 Bytes

Versions: 20

Compression:

Stored size: 455 Bytes

Contents

# frozen_string_literal: true
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

20 entries across 20 versions & 1 rubygems

Version Path
puppet-8.3.0 lib/puppet/settings/enum_setting.rb
puppet-8.3.0-x86-mingw32 lib/puppet/settings/enum_setting.rb
puppet-8.3.0-x64-mingw32 lib/puppet/settings/enum_setting.rb
puppet-8.3.0-universal-darwin lib/puppet/settings/enum_setting.rb
puppet-8.3.1 lib/puppet/settings/enum_setting.rb
puppet-8.3.1-x86-mingw32 lib/puppet/settings/enum_setting.rb
puppet-8.3.1-x64-mingw32 lib/puppet/settings/enum_setting.rb
puppet-8.3.1-universal-darwin lib/puppet/settings/enum_setting.rb
puppet-8.2.0 lib/puppet/settings/enum_setting.rb
puppet-8.2.0-x86-mingw32 lib/puppet/settings/enum_setting.rb
puppet-8.2.0-x64-mingw32 lib/puppet/settings/enum_setting.rb
puppet-8.2.0-universal-darwin lib/puppet/settings/enum_setting.rb
puppet-8.1.0 lib/puppet/settings/enum_setting.rb
puppet-8.1.0-x86-mingw32 lib/puppet/settings/enum_setting.rb
puppet-8.1.0-x64-mingw32 lib/puppet/settings/enum_setting.rb
puppet-8.1.0-universal-darwin lib/puppet/settings/enum_setting.rb
puppet-8.0.1 lib/puppet/settings/enum_setting.rb
puppet-8.0.1-x86-mingw32 lib/puppet/settings/enum_setting.rb
puppet-8.0.1-x64-mingw32 lib/puppet/settings/enum_setting.rb
puppet-8.0.1-universal-darwin lib/puppet/settings/enum_setting.rb