Class: Proc

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

Instance Method Summary collapse

Instance Method Details

#to_methodObject



29
30
31
32
# File 'lib/ambition/core_ext.rb', line 29

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

#to_sexpObject



34
35
36
37
# File 'lib/ambition/core_ext.rb', line 34

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