ruby.social is one of the many independent Mastodon servers you can use to participate in the fediverse.
If you are interested in the Ruby programming language, come join us! Tell us about yourself when signing up. If you just want to join Mastodon, another server will be a better place for you.

Administered by:

Server stats:

1.1K
active users

Interesting (and useful!) behavior for how constants are looked up when multiple modules are included into a class. Constants within modules are prioritized over the included modules themselves.

module Namespace
class Foo
end
end

module Mixins
module Foo
end
end

class Base
include Namespace
include Mixins::Foo

p Foo
end
# => Namespace::Foo

This behavior prevents constant name shadowing when you include a module, but still want to access a class of the same name.