Skip to content

Instantly share code, notes, and snippets.

@hackervera
Created September 22, 2010 08:53
Show Gist options
  • Save hackervera/591378 to your computer and use it in GitHub Desktop.
Save hackervera/591378 to your computer and use it in GitHub Desktop.
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment