Created
March 16, 2009 21:05
-
-
Save auser/80073 to your computer and use it in GitHub Desktop.
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
class Pop | |
def initialize(&block) | |
instance_eval &block if block | |
puts default_doop | |
end | |
def default_doop | |
self.class.doop | |
end | |
def self.doop | |
@doop | |
end | |
def self.default_doop(str) | |
@doop ||= str | |
end | |
default_doop "Not default" | |
end | |
Pop.new do | |
@doop = "Inside instance" | |
Pop.new | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment