-
Notifications
You must be signed in to change notification settings - Fork 103
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add to_s #42
Comments
I try to avoid all normal method names on the MarkUp object to avoid clashes with XML tag names. Will someone have an XML tag named "to_s"? Probably not, but I'm not in fond of setting a precedent. |
What about |
Or maybe not an alias but the method I gave above. |
I'm ok with the to_s! method, (provided it fails for non-string targets). But I'm not seeing how it actually solves the problem of forgetting that to_s doesn't actually exist. |
Because it jogs the memory when reading the documentation. When looking through the methods on the object, |
I think this causes an issue with
It seems like a few methods, |
I've used Builder for several projects over the last few years and every time I make the same API mistake: I use #to_s to finalize the built document.
Only to find that I've injected an extra, unwanted
<to_s/>
element. A naive approach might try this:But I know you just require the :<< method, thus allowing direct IO, which can't convert to a String. Perhaps something like this:
WDYT?
The text was updated successfully, but these errors were encountered: