Skip to content

Instantly share code, notes, and snippets.

@jeffreyiacono
Created November 19, 2012 03:41
Show Gist options
  • Select an option

  • Save jeffreyiacono/4108822 to your computer and use it in GitHub Desktop.

Select an option

Save jeffreyiacono/4108822 to your computer and use it in GitHub Desktop.
Ruby fun with UTF-8
# encoding: UTF-8
class Weather
def ☃
"I'm a snowman!"
end
def ☁
"Looking like a cloudy day"
end
def ☂
"It's going to rain"
end
def ☼
"Sun and fun are in your future"
end
end
weather = Weather.new
puts weather.☼
puts weather.☂
puts weather.☁
puts weather.☃
__END__
Did you know you can use UTF-8 characters in your Ruby code?
Well, you can (see above!). Did you also know that anything
after __END__ will NOT be evaluated? Well, it isn't.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment