Skip to content

Instantly share code, notes, and snippets.

@jackcasey
Created August 7, 2012 03:37
Show Gist options
  • Save jackcasey/3281206 to your computer and use it in GitHub Desktop.
Save jackcasey/3281206 to your computer and use it in GitHub Desktop.
module FancyPants
class User
def name
"Mr. #{self.lastname}"
end
end
class Company
def name
"#{super()} Est. #{self.created_at.year}"
end
end
end
using FancyPants do
(Users.all + Companies.all).each {|entity| puts entity.name }
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment