Last active
December 11, 2015 01:09
-
-
Save mariozig/4521568 to your computer and use it in GitHub Desktop.
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/
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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