Class: Matchi::Matcher::BeAnInstanceOf
- Defined in:
- lib/matchi/matcher/be_an_instance_of.rb
Overview
Type/class matcher.
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
-
#initialize(expected) ⇒ BeAnInstanceOf
constructor
Initialize the matcher with an object.
-
#matches? ⇒ Boolean
Boolean comparison between the class of the actual value and the expected class.
Methods inherited from Base
Constructor Details
#initialize(expected) ⇒ BeAnInstanceOf
Initialize the matcher with an object.
15 16 17 18 |
# File 'lib/matchi/matcher/be_an_instance_of.rb', line 15 def initialize(expected) super() @expected = expected end |
Instance Method Details
#matches? ⇒ Boolean
Boolean comparison between the class of the actual value and the expected class.
30 31 32 |
# File 'lib/matchi/matcher/be_an_instance_of.rb', line 30 def matches?(*, **) expected.equal?(yield.class) end |