Closed janko closed 2 years ago
The block deliberately set to an attribute, so that any time while handling an internal request, you can call the block to get per-request behavior. I guess there isn't an example of using this in the specs, but there probably should be.
I see, that makes sense, I didn't realize that was a feature for other internal request methods 👍🏻
I was looking at the inspect output of the internal request instance for a named auth class when using
internal_request_eval
, and I noticed it was busier than I expected:In rodauth-rails, there is a wrapper around
internal_request_eval
that returns the internal request instance, so it would be easy for me to remove@internal_request_block
and@internal_request_return_value
instance variables there before returning the instance.However, it didn't seem to me like it was necessary to assign the block passed to
internal_request_eval
to an attribute accessor, so I made the change to pass the block down directly through the method chain. Let me know what you think of this change.