class ApproximateValue

Public Class Methods

new(me, acceptable_delta) click to toggle source
# File lib/test_ish.rb, line 9
def initialize(me, acceptable_delta)
  @me = me
  @acceptable_delta = acceptable_delta
end

Public Instance Methods

==(other) click to toggle source
# File lib/test_ish.rb, line 14
def ==(other)
  (other - @me).abs < @acceptable_delta
end
to_s() click to toggle source
# File lib/test_ish.rb, line 18
def to_s
  "within #{@acceptable_delta} of #{@me}"
end