Class: LogStash::Setting::PositiveInteger
- Inherits:
-
Integer
- Object
- LogStash::Setting
- Coercible
- Integer
- LogStash::Setting::PositiveInteger
- Defined in:
- lib/logstash/settings.rb
Instance Attribute Summary
Attributes inherited from LogStash::Setting
Instance Method Summary collapse
-
#initialize(name, default = nil, strict = true) ⇒ PositiveInteger
constructor
A new instance of PositiveInteger.
Methods inherited from Integer
Methods inherited from Coercible
Methods inherited from LogStash::Setting
#==, #reset, #set, #set?, #strict?, #to_hash, #validate_value, #value
Methods included from Util::Loggable
included, #logger, #slow_logger
Constructor Details
#initialize(name, default = nil, strict = true) ⇒ PositiveInteger
Returns a new instance of PositiveInteger.
306 307 308 309 310 311 312 313 314 |
# File 'lib/logstash/settings.rb', line 306 def initialize(name, default=nil, strict=true) super(name, default, strict) do |v| if v > 0 true else raise ArgumentError.new("Number must be bigger than 0. Received: #{v}") end end end |