Created
January 31, 2013 14:43
-
-
Save wrozka/4683304 to your computer and use it in GitHub Desktop.
Hardcoded dependencies
This file contains 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 HasClassName | |
def name | |
self.class.name | |
end | |
end | |
class UserFinder | |
include HasClassName | |
end | |
class UserStatusReader | |
include HasClassName | |
end | |
class Thing | |
def combined_names | |
"#{UserFinder.new.name} and #{UserStatusReader.new.name}" | |
end | |
end | |
thing = Thing.new | |
puts "The combined names are: #{thing.combined_names}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment