Class: SexpCliTools::Matchers::MethodImplementation
- Inherits:
-
Object
- Object
- SexpCliTools::Matchers::MethodImplementation
- Defined in:
- lib/sexp_cli_tools/matchers/method_implementation.rb
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(target_method) ⇒ MethodImplementation
constructor
A new instance of MethodImplementation.
- #satisfy?(sexp) ⇒ Boolean
Constructor Details
#initialize(target_method) ⇒ MethodImplementation
Returns a new instance of MethodImplementation.
8 9 10 |
# File 'lib/sexp_cli_tools/matchers/method_implementation.rb', line 8 def initialize(target_method) @matcher = Sexp::Matcher.parse("[child (defn #{target_method} ___)]") end |
Class Method Details
.satisfy?(sexp, target_method) ⇒ Boolean
4 5 6 |
# File 'lib/sexp_cli_tools/matchers/method_implementation.rb', line 4 def self.satisfy?(sexp, target_method) new(target_method).satisfy?(sexp) end |
Instance Method Details
#satisfy?(sexp) ⇒ Boolean
12 13 14 |
# File 'lib/sexp_cli_tools/matchers/method_implementation.rb', line 12 def satisfy?(sexp) @matcher.satisfy?(sexp) end |