Created
August 15, 2012 15:40
-
-
Save kwilczynski/3361084 to your computer and use it in GitHub Desktop.
a, b and c
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 Array | |
def some_join_method | |
s = String.new | |
self.each_with_index do |v,i| | |
s << ((i + 1 == self.size) ? "and #{v}" : "#{v}, ") | |
end | |
return s | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment