Skip to content

Instantly share code, notes, and snippets.

@envaman
envaman / inwords
Created September 17, 2012 23:11
translates numbers in words
module InWords
def in_words
4 == "four"
end
def in_words
17 == "seventeen"
end
def in_words
@envaman
envaman / weathercity
Created September 16, 2012 21:24
weather output
def weather(city)
w = {:san_francisco => 60, :chicago => 30, :miami => 70, :los_angeles => 80, :achorage => 10}
w.each { |key,val| puts "#{key} == #{val} "}
end
Weather returns the weather in various cities
expected: 60 got: {:san_francisco=>60, :chicago=>30, :miami=>70, :los_angeles=>80, :achorage=>10} (compared using ==)
Output: