class InputSanitizer::PositiveIntegerConverter
Public Instance Methods
call(value)
click to toggle source
Calls superclass method
# File lib/input_sanitizer/extended_converters/positive_integer_converter.rb, line 3 def call(value) super.tap { |value| raise_error if value <= 0 } end
Private Instance Methods
raise_error()
click to toggle source
# File lib/input_sanitizer/extended_converters/positive_integer_converter.rb, line 8 def raise_error raise ConversionError.new("invalid integer (neagtive or zero)") end