Class: Proc
- Inherits:
-
Object
- Object
- Proc
- Defined in:
- lib/parsetree/lib/parse_tree_extensions.rb
Instance Method Summary collapse
Instance Method Details
#to_ruby ⇒ Object
56 57 58 |
# File 'lib/parsetree/lib/parse_tree_extensions.rb', line 56 def to_ruby Ruby2Ruby.new.process(self.to_sexp).sub(/^\Aproc do/, 'proc {').sub(/end\Z/, '}') end |
#to_sexp ⇒ Object
50 51 52 53 54 |
# File 'lib/parsetree/lib/parse_tree_extensions.rb', line 50 def to_sexp pt = ParseTree.new(false) sexp = pt.parse_tree_for_proc(self) Unifier.new.process(sexp) end |