Created
November 7, 2012 16:04
-
-
Save jxpx777/4032463 to your computer and use it in GitHub Desktop.
Simple example against using bang methods
This file contains hidden or 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
#!/usr/bin/env ruby | |
class FunTime | |
def initialize | |
@array = ['foo', 'bar', 'zing'] | |
end | |
def gimme_bar | |
hinky | |
bar = @array[1] | |
puts bar.inspect | |
end | |
def hinky | |
@array.sort! | |
end | |
end | |
FunTime.new.gimme_bar |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment