Created
August 7, 2012 03:37
-
-
Save jackcasey/3281206 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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