Skip to content

Instantly share code, notes, and snippets.

@kwilczynski
Created August 15, 2012 15:40
Show Gist options
  • Save kwilczynski/3361084 to your computer and use it in GitHub Desktop.
Save kwilczynski/3361084 to your computer and use it in GitHub Desktop.
a, b and c
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