Skip to content

Instantly share code, notes, and snippets.

@giddie
Created May 22, 2012 14:47
Show Gist options
  • Save giddie/2769522 to your computer and use it in GitHub Desktop.
Save giddie/2769522 to your computer and use it in GitHub Desktop.
A bit of fun for Dave :)
Ruby = 'Ruby'
class Kitson
def initialize(name)
puts "There is a new Kitson named #{name.capitalize}."
end
def is_enjoying?(something)
ret = (something == 'Ruby')
print "He "
if ret
print "definitely enjoys"
else
print "doesn't enjoy"
end
puts " #{something}."
end
end
Kitson.new(:dave).is_enjoying?(Ruby)
print 'Press <enter> to close...'
gets
@giddie
Copy link
Author

giddie commented May 22, 2012

This is really just for a laugh, to make the Kitson.new... line actually do something. Not the best example of programming otherwise, except to illustrate that you can get away with pretty much anything in Ruby :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment