Skip to content

Instantly share code, notes, and snippets.

@ignacy
Created July 5, 2010 19:09
Show Gist options
  • Save ignacy/464611 to your computer and use it in GitHub Desktop.
Save ignacy/464611 to your computer and use it in GitHub Desktop.
module B
def a
"a"
end
end
B.a #=> undefined method
module B
class << self
def a
"a"
end
end
end
B.a #==> "a"
@slawosz
Copy link

slawosz commented Aug 3, 2010

other way to make B.a work

module B
extend self
def a
"a"
end
end

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment