Post #2812308
2025-10-15 02:35 UTC
@afomera@ruby.social @hanami@ruby.social this is one thing I « dislike » about Hanami: the screenshot above is six levels of indentation, before I write anything.
I believe Hanami uses Zeitwerk? If so, why aren’t the generated classes using the « short » version of class declarations?
class Bookshelf::Actions::Users::Params < Hanami::Action::Params
params do
# my code
end
end
I feel like that would improve readability. I know, open source, contribute. I’m not using Hanami yet. I would, when I’ll use it.
Replies (1)
-
@afomera@ruby.social 2025-10-15 02:51
@francois@ruby.social @hanami@ruby.social You can use the shorthand syntax like you're asking for sure. One thing to note is using the container `Deps` includes in that style you'd have to call MyApp::Deps instead of just `Deps` unless you used a module of your App and then did the shorthand style (so one layer of nesting). This is since the constants won't be loaded in the shorthand style automatically. module MyApp class Actions::Users::Params < Hanami::Action::Params include Deps["view.."]