Class: SexpCliTools::Matchers::MethodImplementation

Inherits:
Object
  • Object
show all
Defined in:
lib/sexp_cli_tools/matchers/method_implementation.rb

Class Method Summary collapse

Instance Method Summary collapse

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

Returns:

  • (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

Returns:

  • (Boolean)


12
13
14
# File 'lib/sexp_cli_tools/matchers/method_implementation.rb', line 12

def satisfy?(sexp)
  @matcher.satisfy?(sexp)
end