Last Updated: February 25, 2016
·
724
· danielmorrison

The I in Team (in Ruby)

# Inspired by http://www.neatorama.com/2012/06/13/there-is-an-i-in-team/

class String

  alias_method :original_count, :count

  def count(other)
    if self == 'team' && other.downcase == 'i'
      1
    else
      original_count(other)
    end
  end
end