Skip to content

Instantly share code, notes, and snippets.

@timabdulla
Created July 5, 2012 16:23
Show Gist options
  • Save timabdulla/6483382e261039b948c0 to your computer and use it in GitHub Desktop.
Save timabdulla/6483382e261039b948c0 to your computer and use it in GitHub Desktop.
module A
@@foo = "bar"
def foo
puts @@foo
end
end
class B
extend A
@@foo = "baz"
def self.my_foo
puts @@foo
end
end
puts B.foo #=> bar
puts B.my_foo #=> baz
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment