James Adam · @james
3153 followers · 1275 posts · Server ruby.social

@henrik just to be absolutely sure, have you called `to_s` on that exact object instance and seen it return a value? I know it's wacky but it's at least technically still possible to redefine <String instance> on individual objects πŸ˜…

#to_s

Last updated 2 years ago

Jean Boussier · @byroot
301 followers · 89 posts · Server ruby.social

@floehopper it's not gonna break Mocha. The method is defined in Object, you define yours in a subclass, it has precedence.

It's like redefining any other method from `Object` in a subclass, e.g. `` or ``.

The reason it broke in RSpec is because they were dynamically copying methods over and were not ignoring methods inherited from objects.

#to_s #inspect

Last updated 2 years ago

alexanderadam · @alexanderadam
329 followers · 3480 posts · Server ruby.social

RT @GregMolnar@twitter.com

In Ruby 3.2.0, ERB::Util.html_escape is made faster than CGI.escapeHTML, by no longer allocating a String object when no character needs to be escaped.
It also skips calling method when an argument is already a String..

πŸ¦πŸ”—: twitter.com/GregMolnar/status/

#to_s

Last updated 3 years ago

@gd @penryu My deal with types in Ruby is that I often do not care what a thing is so long as it acts like another thing. Frequently I can just say "Enumerable" but other times, I only care I can something and what that is doesn't matter. is another one of those. Is it a class, class instance, proc, lambda, ...? I don't care. I'm simply 'ing whatever. The dominant Ruby type systems don't handle this case well.

#to_s #call

Last updated 3 years ago

GenghisKen Coar · @GenghisKen
28 followers · 91 posts · Server ruby.social

@MoskitoHero
Ehh, but that immediately makes me think of π™Έπš—πšπšŽπšπšŽπš›(𝟸). Maybe since doesn't actually have a 'Boolean' class?

/me shrugs

#to_s #to_bool #ruby

Last updated 3 years ago

εŒ—εΈ‚ηœŸ · @KitaitiMakoto
109 followers · 5223 posts · Server bookwor.ms

まあ とか とかでもいいか。

#to_s #to_str

Last updated 4 years ago