Make Hanami::View::Rendering::LayoutScope
to inherit from Hanami::Utils::BasicObject
#160
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What
Make
Hanami::View::Rendering::LayoutScope
to inherit fromHanami::Utils::BasicObject
instead from Ruby'sBasicObject
.This ensures a better interoperability with latest
tilt
changes. See rtomayko/tilt#347Technical details
Hanami::View::Rendering::LayoutScope#is_a?
is no longer implicitly dispatched to the internal@scope
as per effect of#method_missing
. BecauseHanami::Utils::BasicObject
implements#is_a?
,#method_missing
is no longer called. It's important forHanami::View::Rendering::LayoutScope
to take control on#is_a?
because it led to unexpected behaviors likeis_a?(Module)
to returntrue
, because the current@scope
was aModule
. Of courseHanami::View::Rendering::LayoutScope
isn't aModule
, but a basic object, and#is_a?
must reflect it.Hanami::View::Rendering::LayoutScope#class
was removed because it's already implemented by the new superclass:Hanami::Utils::BasicObject
.The behavior of
#inspect
is extracted into the private method#__inspect
. This is aUtils::BasicObject
hook to allow its subclasses to define their own inspect logic.Hanami::View::Rendering::LayoutScope
will still continue to respond to#inspect
and to return the same inspecting string. The implementation is now split between the new superclass and the layout scope itself.Gemfile
temporary points tohanami-utils
branch that contains anotherUtils::BasicObject
fix that makeshanami-view
build to pass withtilt
2.0.10
. See LetUtils::BasicObject
to lookup constants at the top-level namespace utils#343