Class: Punchout::Matcher::Progeny

Inherits:
Object
  • Object
show all
Includes:
Punchout::Matcher
Defined in:
lib/punchout/matcher/progeny.rb

Overview

Matches when the candidate’s class matches the subject class of this matcher, or any descendant of that subject.

This Matcher is handy for punching against a set of classes that all mixin the same module.

Instance Method Summary collapse

Methods included from Punchout::Matcher

#conflicts?, #initialize, #punches

Instance Method Details

#matches?(candidate) ⇒ Boolean

Returns:

  • (Boolean)


14
15
16
# File 'lib/punchout/matcher/progeny.rb', line 14

def matches?(candidate)
  (@subject <= candidate.class) == true
end