Skip to content

Instantly share code, notes, and snippets.

@scalone
Created November 5, 2010 18:51
Show Gist options
  • Save scalone/664595 to your computer and use it in GitHub Desktop.
Save scalone/664595 to your computer and use it in GitHub Desktop.
ruby class varible
@@ha = 'ha'
class A
class << self
@ha = 'boo'
end
def self.ha
@ha
end
end
p @@ha
# "ha"
p A.class_eval{@@ha}
# "ha"
p A.class_eval{@ha}
# nil
p A.ha
# nil
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment