Module: Paramore::Int

Defined in:
lib/paramore/types.rb

Class Method Summary collapse

Class Method Details

.[](input) ⇒ Object

Raises:

  • (ArgumentError)


36
37
38
39
40
# File 'lib/paramore/types.rb', line 36

def [](input)
  raise ArgumentError, "#{input} is not an Integer!" unless input.to_s.match?(TypeRegexes::INTEGER_REGEX)

  input.to_i
end