Class: Proc

Inherits:
Object show all
Defined in:
lib/engine2/core.rb

Instance Method Summary collapse

Instance Method Details

#chain(&blk) ⇒ Object



31
32
33
34
35
36
37
# File 'lib/engine2/core.rb', line 31

def chain &blk
    proc = self
    lambda do |obj|
        obj.instance_eval(&proc)
        obj.instance_eval(&blk)
    end
end

#to_jsonObject



26
27
28
29
# File 'lib/engine2/core.rb', line 26

def to_json(*)
    loc = source_location
    "\"#<Proc:#{loc.first[/\w+.rb/]}:#{loc.last}>\""
end