adam12 changed the topic of #ruby to: Rules: https://ruby-community.com | Ruby 3.0.2, 2.7.4, 2.6.8: https://www.ruby-lang.org | Paste 4+ lines to: https://gist.github.com | Books: https://goo.gl/wpGhoQ
bit4bit has quit [Quit: Leaving]
mrkz_c has joined #ruby
gggpkm has joined #ruby
prime has joined #ruby
___nick___ has joined #ruby
prime has quit [Quit: and then my friend you die]
ur5us_ has joined #ruby
Skyfire has quit [Quit: brb]
Rounin has quit [Ping timeout: 252 seconds]
ur5us_ has quit [Ping timeout: 260 seconds]
hololeap has quit [Remote host closed the connection]
hololeap has joined #ruby
gr33n7007h has quit [Ping timeout: 252 seconds]
gr33n7007h has joined #ruby
maria_elis has quit [Ping timeout: 252 seconds]
swaggboi has quit [Quit: C-x C-c]
swaggboi has joined #ruby
tbaeder has joined #ruby
gr33n7007h has quit [Quit: WeeChat 3.2.1]
swaggboi has quit [Ping timeout: 252 seconds]
swaggboi has joined #ruby
gggpkm has quit [Ping timeout: 252 seconds]
yosafbridge` has quit [Quit: Leaving]
hololeap has quit [Ping timeout: 276 seconds]
ur5us_ has joined #ruby
yosafbridge has joined #ruby
hololeap has joined #ruby
unmanbearpig has joined #ruby
reset has quit [Quit: reset]
hololeap has quit [Remote host closed the connection]
hololeap has joined #ruby
hololeap has quit [Remote host closed the connection]
Oxfuxxx has quit [Quit: Never underestimate the power of the butt....ON. (Playst...i mean.. Pir@tA$$)]
insolentworm has quit [Quit: WeeChat 3.2]
Oxfuxxx has joined #ruby
ur5us_ has quit [Ping timeout: 260 seconds]
hololeap has joined #ruby
sharkee has quit [Ping timeout: 260 seconds]
swaggboi has quit [Ping timeout: 252 seconds]
_ht has joined #ruby
Oxfuxxx has quit [Ping timeout: 252 seconds]
sharkee has joined #ruby
unmanbearpig has joined #ruby
unmanbearpig has quit [Changing host]
hololeap has quit [Remote host closed the connection]
sharkee has quit [Read error: Connection reset by peer]
sharkee has joined #ruby
Oxfuxxx has joined #ruby
Skyfire has joined #ruby
Oxfuxxx has quit [Ping timeout: 252 seconds]
Oxfuxxx has joined #ruby
sharkee has quit [Ping timeout: 260 seconds]
Oxfuxxx has quit [Ping timeout: 252 seconds]
Oxfuxxx has joined #ruby
sharkee has joined #ruby
shark_FWX has joined #ruby
shark_FWX has quit [Read error: Connection reset by peer]
sharkee has quit [Ping timeout: 252 seconds]
sharkee has joined #ruby
Oxfuxxx has quit [Ping timeout: 252 seconds]
Oxfuxxx has joined #ruby
mikrosis has joined #ruby
Rounin has joined #ruby
tbaeder has quit [Ping timeout: 252 seconds]
mbrndtgn has quit [Quit: The Lounge - https://thelounge.chat]
sharkee has quit [Ping timeout: 265 seconds]
mbrndtgn has joined #ruby
sharkee has joined #ruby
Oxfuxxx has quit [Ping timeout: 265 seconds]
Oxfuxxx has joined #ruby
Oxfuxxx has quit [Client Quit]
hololeap has joined #ruby
goldfish has joined #ruby
gr33n7007h has joined #ruby
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]
<Petruchio> Well, it looks like Array#to_s is also: https://ruby-doc.org/core-2.7.2/Array.html#method-i-to_s
Milos has quit [Quit: ZNC 1.8.2 - https://znc.in]
Milos has joined #ruby
<Petruchio> I guess there are a few levels to my question. One is: how can I predict the behavior? Another is: why is this behavior a good idea?
Oxfuxxx has quit [Ping timeout: 252 seconds]
sharkee has quit [Ping timeout: 260 seconds]
sharkee has joined #ruby
sharkee has quit [Read error: Connection reset by peer]
sharkee has joined #ruby
dannyAAM has joined #ruby
shark_VVO has joined #ruby
Oxfuxxx has joined #ruby
sharkee has quit [Ping timeout: 265 seconds]
dannyAAM has quit [Remote host closed the connection]
shark_VVO has quit [Ping timeout: 252 seconds]
dannyAAM has joined #ruby
Oxfuxxx has quit [Ping timeout: 265 seconds]
Ben10 has left #ruby [#ruby]
<weaksauce> i always thought inspect was more of a debugging thing Petruchio
<weaksauce> or what was called by p
<weaksauce> so i'm not sure why that was merged
<weaksauce> maybe there is a bug somewhere that highlights this?
_ht has quit [Remote host closed the connection]
<nakilon> Petruchio you can detect aliases
<nakilon> a.method(:reduce) => true
<nakilon> a.method(:inject) == a.method(:inspect) => false
<nakilon> a.method(:inject) == a.method(:reduce) => true
<nakilon> (ignore the first copypasta line)
<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]
ur5us_ has quit [Ping timeout: 260 seconds]
r3my has joined #ruby
ur5us_ has joined #ruby
ur5us_ has quit [Ping timeout: 260 seconds]
swaggboi has joined #ruby