I'll write this up in more detail at some point, but in going over Pickaxe copyedits, I realized I left out a nuance about constant lookup, which is that if you define a module like this:

```
module Outer
CONST = “outer”
end
```

And then a class namespaced but without nesting references that constant:::

```
class Outer::Inner
def self.value = CONST
end
```

Ruby won't look in `Outer` for the constant value…

3
Share
Share on Mastodon
Share on Twitter
Share on Facebook
Share on Linkedin
Evan Light

@noelrap Sorry but :::: ?

1
1y
1
1y
roman

@noelrap It is more confusing because rails convention is to create the shallow nested class names. I much prefer the module namespace way.

I feel like people just don’t like being three modules deep and keeping track of their autoformated indentation🙄 Probably why Hanami actions looks so foreign to many rails devs.

0
1y
Replies