Skip to content

Instantly share code, notes, and snippets.

@hackervera
Created September 22, 2010 08:53

Revisions

  1. hackervera created this gist Sep 22, 2010.
    10 changes: 10 additions & 0 deletions higher.rb
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,10 @@
    class Main
    def self.higherOrder(proc_in)
    return proc { |arg| arg + proc_in[5] }
    end
    end

    foo = proc {|arg| arg + 1}


    puts Main::higherOrder(foo)[3] #=> 9