Skip to content

Instantly share code, notes, and snippets.

@kek
Created August 13, 2012 15:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kek/3342046 to your computer and use it in GitHub Desktop.
Save kek/3342046 to your computer and use it in GitHub Desktop.
Experiment with Object
class Object
def chain
yield self
end
end
puts 1.chain { |x| x + 1 }.chain { |x| x + 1 }
@ramn
Copy link

ramn commented Sep 1, 2012

This seems very powerful and useful. Ruby is a powerful language.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment