sharkee has quit [Remote host closed the connection]
Oxfuxxx has joined #ruby
gggpkm has joined #ruby
reset has joined #ruby
pwnd_sfw has quit [Quit: Ping timeout (120 seconds)]
pwnd_sfw has joined #ruby
maria_elis has joined #ruby
darkxploit has quit [Ping timeout: 252 seconds]
Oxfuxxx has quit [Ping timeout: 252 seconds]
darkxploit has joined #ruby
Oxfuxxx has joined #ruby
Oxfuxxx has quit [Ping timeout: 265 seconds]
Oxfuxxx has joined #ruby
Oxfuxxx__ has joined #ruby
Oxfuxxx has quit [Ping timeout: 240 seconds]
gggpkm has quit [Ping timeout: 265 seconds]
sharkee has joined #ruby
sharkee has quit [Remote host closed the connection]
cheres has joined #ruby
Oxfuxxx__ is now known as oxfuxxx
dannyAAM has quit [Quit: znc.saru.moe : ZNC 1.6.2 - http://znc.in]
oxfuxxx is now known as Oxfuxxx
dannyAAM has joined #ruby
sharkee has joined #ruby
cheres has quit [Quit: WeeChat 3.2.1]
Petruchio has joined #ruby
<Petruchio>
Hi. I'm puzzled about to_s behavior. I have a class, X, where I define to_s. I call puts on an x, and to_s gets called. If I call puts on an array of Xs, or an array of arrays, it gets called. If x is a value in a hash, and I puts the hash, to_s doesn't get called. Not sure what rule governs this.
<Petruchio>
I also have the sense that it worked the way I expected in earlier versions (presently using 2.7.2), where to_s was called more consistently, but I'm not quite certain.
Ben10 has joined #ruby
<weaksauce>
it appears hash#to_s is an alias for inspect while other ones are not
dannyAAM has quit [Remote host closed the connection]
<nakilon>
one guy just recently asked it in another place
<nakilon>
I can't teach them come to IRC ..(
<nakilon>
this gives you the whole list of aliases of a class: require "pp"; a = []; pp a.methods.map(&a.method(:method)).group_by(&:itself).map{ |m, g| [m.name, g.map(&:name)] }.sort_by{ |m, g| -g.size }
<Petruchio>
Well, that's clever and interesting.
<weaksauce>
fun
mikrosis has quit [Ping timeout: 265 seconds]
ur5us_ has joined #ruby
mrkz_c has quit [Quit: Connection closed for inactivity]
goldfish has quit [Read error: Connection reset by peer]
goldfish has joined #ruby
mrkz_c has joined #ruby
gggpkm has joined #ruby
goldfish has quit [Remote host closed the connection]