Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
Example for proving that Sublime Text 2 is running through RVM ruby and not the system default ruby. Goes with: http://ruby.zigzo.com/2013/01/11/sublime-text-2-and-rvm/
class Factorial
attr_reader :computed
def initialize(number)
@computed = solve(number)
end
def solve(number)
number > 1 ? number * solve(number-1) : 1
end
end
puts "5! = #{Factorial.new(5).computed}"
puts "And your ruby version is #{RUBY_VERSION}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment