Class: Numeric

Inherits:
Object show all
Defined in:
lib/spec/api/expectations.rb

Instance Method Summary collapse

Instance Method Details

#close?(other, precision) ⇒ Boolean

Returns:

  • (Boolean)


14
15
16
# File 'lib/spec/api/expectations.rb', line 14

def close?(other, precision)
  (self - other).abs < precision
end