Module: NumericCheckExt

Defined in:
lib/sugar-high/numeric.rb

Instance Method Summary collapse

Instance Method Details

#check_numeric!(arg) ⇒ Object

Raises:

  • (ArgumentError)


7
8
9
# File 'lib/sugar-high/numeric.rb', line 7

def check_numeric! arg
  raise ArgumentError, "Argument must be Numeric" if !is_numeric? arg
end

#is_numeric?(arg) ⇒ Boolean Also known as: numeric?

Returns:



2
3
4
# File 'lib/sugar-high/numeric.rb', line 2

def is_numeric? arg
  arg.is_a? Numeric
end