Skip to content

Instantly share code, notes, and snippets.

@mscottford
Created May 25, 2016 18:50
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 mscottford/5f91893247419494e3364359ad4fdbb8 to your computer and use it in GitHub Desktop.
Save mscottford/5f91893247419494e3364359ad4fdbb8 to your computer and use it in GitHub Desktop.
$ irb
irb(main):001:0> require 'active_support/all'
=> true
irb(main):002:0> class Integer
irb(main):003:1> def fact
irb(main):004:2> (1..self).reduce(:*) || 1
irb(main):005:2> end
irb(main):006:1> end
=> nil
irb(main):007:0> 10.fact == 6.weeks
=> true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment