Class: Inspector::Constraints::Eq

Inherits:
Object
  • Object
show all
Defined in:
lib/inspector/constraints/eq.rb

Instance Method Summary collapse

Constructor Details

#initialize(expected) ⇒ Eq

Returns a new instance of Eq.



6
7
8
# File 'lib/inspector/constraints/eq.rb', line 6

def initialize(expected)
  @expected = expected
end

Instance Method Details

#inspectObject



18
19
20
# File 'lib/inspector/constraints/eq.rb', line 18

def inspect
  "#<== #{@expected.inspect}>"
end

#to_sObject



14
15
16
# File 'lib/inspector/constraints/eq.rb', line 14

def to_s
  "eq"
end

#valid?(actual) ⇒ Boolean

Returns:

  • (Boolean)


10
11
12
# File 'lib/inspector/constraints/eq.rb', line 10

def valid?(actual)
  actual == @expected
end