Class: Lookout::Expected::Range

Inherits:
Object show all
Defined in:
lib/lookout-3.0/expected/range.rb

Overview

Represents expected Ranges.

Instance Method Summary collapse

Methods inherited from Object

#expect

Instance Method Details

#difference(actual) ⇒ Difference::Range?

Returns A difference report between ACTUAL and #expected unless they’re ‘#==` or ACTUAL lays within #expected.

Parameters:

Returns:

  • (Difference::Range, nil)

    A difference report between ACTUAL and #expected unless they’re ‘#==` or ACTUAL lays within #expected



8
9
10
11
# File 'lib/lookout-3.0/expected/range.rb', line 8

def difference(actual)
  Lookout::Difference::Range.new(actual, expected) unless
    expected == actual or expected === actual
end