Skip to content

Instantly share code, notes, and snippets.

@ljinke
Last active December 24, 2015 01:29
Show Gist options
  • Save ljinke/6723488 to your computer and use it in GitHub Desktop.
Save ljinke/6723488 to your computer and use it in GitHub Desktop.
:: in Ruby
module Foo
#this class is in Foo::
class Bar
end
#this class is not in Foo:: but in global scope
class ::FooBar
#class method
def self.method1
'method1'
end
def method2
'method2'
end
end
end
Foo::Bar
FooBar
FooBar::method1
FooBar.method1
FooBar::new.method2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment