Skip to content

Instantly share code, notes, and snippets.

@wrozka
Created January 31, 2013 14:43
Show Gist options
  • Save wrozka/4683304 to your computer and use it in GitHub Desktop.
Save wrozka/4683304 to your computer and use it in GitHub Desktop.
Hardcoded dependencies
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