Top Level Namespace

Defined Under Namespace

Modules: ActiveRecord, DoRewrite, Mod1, Mod2, TrackAnds, TrackIfs, TrackNots, TrackOrs, TrackUntils, TrackWhiles, UnifiedRuby, VirtualKeywords Classes: Abstract, AndUser, ApplicationController, CaseWhenUser, Class, ClassInclude, Fizzbuzzer, Greeter, Method, MicroSqlUser, Module, NotUser, OperatorUser, OrUser, ParseTree, ParseTreeGauntlet, ParseTreeTestCase, PostUnifier, PreUnifier, Proc, ProcStoreTmp, QuickPrinter, R2RTestCase, RawParseTree, Something, SomethingWithInitialize, Sql, TestParseTree, TestRawParseTree, TestUnifier, UnboundMethod, Unifier, UntilUser, WhileUser

Instance Method Summary collapse

Instance Method Details

#method_to_sexp(klass, method) ⇒ Object

Given a class and a method name, return a sexpified method.



26
27
28
# File 'lib/spec/spec_helper.rb', line 26

def method_to_sexp(klass, method)
  VirtualKeywords::ParserStrategy.new.translate_instance_method(klass, method)
end

#sexpify_instance_methods(klass) ⇒ Object

Sexpify all non-inherited instance methods of a class and return them in a hash mapping names to sexps.



32
33
34
35
36
37
38
39
# File 'lib/spec/spec_helper.rb', line 32

def sexpify_instance_methods klass
  sexps = {}
  klass.instance_methods(false).each do |method_name|
    sexps[method_name.to_sym] = method_to_sexp(klass, method_name.to_sym)
  end

  sexps
end