Skip to content

Instantly share code, notes, and snippets.

@yous
Last active December 31, 2015 16:02
Show Gist options
  • Save yous/c6200cd90a051db4323a to your computer and use it in GitHub Desktop.
Save yous/c6200cd90a051db4323a to your computer and use it in GitHub Desktop.
Happy New Year
class Happy
def initialize
print "#{self.class} New "
@year = Time.new.year
end
def method_missing(meth)
puts "#{__method__.to_s[/\w+/].capitalize} #{@year}#{meth.to_s[/\W+/]}"
end
end
Happy.new.year
Happy.new.year!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment