Skip to content

Instantly share code, notes, and snippets.

@davidbalbert
Last active December 17, 2015 20:19
Show Gist options
  • Save davidbalbert/5667013 to your computer and use it in GitHub Desktop.
Save davidbalbert/5667013 to your computer and use it in GitHub Desktop.
Ruby should have more multimedia!
>> load 'string_sayer.rb'
>> "Hello, world!"
=> "Hello, world!"
module StringSayer
def inspect
s = super
`say #{s}`
s
end
end
String.send(:prepend, StringSayer)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment