Module: NumericCheckExt

Included in:
GeoDistance
Defined in:
lib/geo_vectors/util/geo_distance.rb

Instance Method Summary collapse

Instance Method Details

#check_numeric!(arg) ⇒ Object

Raises:

  • (ArgumentError)


11
12
13
# File 'lib/geo_vectors/util/geo_distance.rb', line 11

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

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

Returns:

  • (Boolean)


5
6
7
# File 'lib/geo_vectors/util/geo_distance.rb', line 5

def is_numeric? arg
  arg.is_a? Numeric
end