Sha256: ed14459b38518583d0449c8b25928c6d2601ea567819ccb59c68add087bba759

Contents?: true

Size: 453 Bytes

Versions: 28

Compression:

Stored size: 453 Bytes

Contents

# frozen_string_literal: true

class Puppet::Settings::IntegerSetting < Puppet::Settings::BaseSetting
  def munge(value)
    return value if value.is_a?(Integer)

    begin
      value = Integer(value)
    rescue ArgumentError, TypeError
      raise Puppet::Settings::ValidationError, _("Cannot convert '%{value}' to an integer for parameter: %{name}") % { value: value.inspect, name: @name }
    end

    value
  end

  def type
    :integer
  end
end

Version data entries

28 entries across 28 versions & 1 rubygems

Version Path
puppet-8.10.0 lib/puppet/settings/integer_setting.rb
puppet-8.10.0-x86-mingw32 lib/puppet/settings/integer_setting.rb
puppet-8.10.0-x64-mingw32 lib/puppet/settings/integer_setting.rb
puppet-8.10.0-universal-darwin lib/puppet/settings/integer_setting.rb
puppet-8.9.0 lib/puppet/settings/integer_setting.rb
puppet-8.9.0-x86-mingw32 lib/puppet/settings/integer_setting.rb
puppet-8.9.0-x64-mingw32 lib/puppet/settings/integer_setting.rb
puppet-8.9.0-universal-darwin lib/puppet/settings/integer_setting.rb
puppet-8.8.1 lib/puppet/settings/integer_setting.rb
puppet-8.8.1-x86-mingw32 lib/puppet/settings/integer_setting.rb
puppet-8.8.1-x64-mingw32 lib/puppet/settings/integer_setting.rb
puppet-8.8.1-universal-darwin lib/puppet/settings/integer_setting.rb
puppet-8.7.0 lib/puppet/settings/integer_setting.rb
puppet-8.7.0-x86-mingw32 lib/puppet/settings/integer_setting.rb
puppet-8.7.0-x64-mingw32 lib/puppet/settings/integer_setting.rb
puppet-8.7.0-universal-darwin lib/puppet/settings/integer_setting.rb
puppet-8.6.0 lib/puppet/settings/integer_setting.rb
puppet-8.6.0-x86-mingw32 lib/puppet/settings/integer_setting.rb
puppet-8.6.0-x64-mingw32 lib/puppet/settings/integer_setting.rb
puppet-8.6.0-universal-darwin lib/puppet/settings/integer_setting.rb