Class: Inspector::Constraints::Eq
- Inherits:
-
Object
- Object
- Inspector::Constraints::Eq
- Defined in:
- lib/inspector/constraints/eq.rb
Instance Method Summary collapse
-
#initialize(expected) ⇒ Eq
constructor
A new instance of Eq.
- #inspect ⇒ Object
- #to_s ⇒ Object
- #valid?(actual) ⇒ Boolean
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
#inspect ⇒ Object
18 19 20 |
# File 'lib/inspector/constraints/eq.rb', line 18 def inspect "#<== #{@expected.inspect}>" end |
#to_s ⇒ Object
14 15 16 |
# File 'lib/inspector/constraints/eq.rb', line 14 def to_s "eq" end |
#valid?(actual) ⇒ Boolean
10 11 12 |
# File 'lib/inspector/constraints/eq.rb', line 10 def valid?(actual) actual == @expected end |