Class: Proc

Inherits:
Object
  • Object
show all
Defined in:
lib/ambition/lib/proc_to_ruby.rb

Instance Method Summary collapse

Instance Method Details

#to_methodObject



27
28
29
30
# File 'lib/ambition/lib/proc_to_ruby.rb', line 27

def to_method
  Unique.send(:define_method, :proc_to_method, self)
  Unique.new.method(:proc_to_method)
end

#to_sexpObject



32
33
34
35
# File 'lib/ambition/lib/proc_to_ruby.rb', line 32

def to_sexp
  body = self.to_method.to_sexp[2][1..-1]
  [:proc, *body]
end