Skip to content

Instantly share code, notes, and snippets.

@sheldonh
Created August 3, 2009 08:53
Show Gist options
  • Save sheldonh/160425 to your computer and use it in GitHub Desktop.
Save sheldonh/160425 to your computer and use it in GitHub Desktop.
#!/usr/bin/env ruby
module Loud
module ClassMethods
def shout(message)
loud = if message =~ /!$/
message.upcase
else
message.upcase + '!'
end
puts loud
end
end
def self.included(mod)
mod.extend(ClassMethods)
end
end
include Loud
shout "Hello, world!"
shout "Um, hello?"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment