You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# Remove all instance methods so even things like class()# get handled by method_missing(). <lifted from activerecord>instance_methods.eachdo |m|
unlessm.to_s =~ /^(?:nil\?|send|object_id|to_a|tap)$|^__|^respond_to/undef_methodmendend
This undefing is too severe and can cause issues when methods common to most objects are not available. #123 describes an issue with RSpec expectations. Additionally, inspecting instances of ElementProxy in debuggers like Rubymine can sometimes crash the debugger.
Reimplement the proxy code in ElementProxy to be less severe.
Some ideas:
Use SimpleDelegator.
Don't undef any methods.
The text was updated successfully, but these errors were encountered:
Another idea here would be to collapse the ElementProxy behavior into Element whereby the internal node attribute would function as the "implicit_element" of ElementProxy.
This would mean that callers would get references to instances of Element subclasses, making is_a? checks easier, but also changing the contract of methods generated by the element DSL.
It's unclear if this change would require a major version bump.
It's unclear if this change would require a major version bump.
Technically removing ElementProxy is a breaking change, which would require a majort version bump. Although, I'm not sure if it was possible to know that ElementProxy actually existed, without looking in the source code
ElementProxy
undefs a bunch of standard methods on objects:This undefing is too severe and can cause issues when methods common to most objects are not available. #123 describes an issue with RSpec expectations. Additionally, inspecting instances of
ElementProxy
in debuggers like Rubymine can sometimes crash the debugger.Reimplement the proxy code in
ElementProxy
to be less severe.Some ideas:
SimpleDelegator
.The text was updated successfully, but these errors were encountered: