<user9d>
What is the difference between def methodA!: def methodB?: and def methodC: #?
jhass has quit [Ping timeout: 240 seconds]
jhass has joined #ruby
<havenwood>
user9d: meth is a regular method, meth! is a "more dangerous" version of meth, and meth? is a predicate method that returns something truthy or falsey.
<user9d>
havenwood: aahh! what is the meth! method called? Like what's the ruby name for it? Super method? Powerful method? Wizardry method? Imprinting method?
jl- has joined #ruby
jl- has quit [Ping timeout: 256 seconds]
<havenwood>
user9d: bang method, I guess?
<havenwood>
user9d: Typically theres a `foo` version first and `foo!` either modifies the receiver or does something else more suspicious.
<havenwood>
Predicate methods are much more common than bang methods.
<havenwood>
But you see both, for sure.
Ziyan has joined #ruby
rvalue has quit [Ping timeout: 256 seconds]
Jantz has joined #ruby
Jantz has quit [Ping timeout: 255 seconds]
rwaweber has joined #ruby
jl- has joined #ruby
jl- has quit [Ping timeout: 276 seconds]
jpn has joined #ruby
jpn has quit [Ping timeout: 256 seconds]
Wra1th has joined #ruby
rvalue has joined #ruby
_ht has joined #ruby
Sankalp has quit [Ping timeout: 244 seconds]
Wra1th has quit [Quit: wra1th]
_ht has quit [Remote host closed the connection]
Sankalp has joined #ruby
rvalue has quit [Read error: Connection reset by peer]
rvalue has joined #ruby
Wra1th has joined #ruby
dionysus69 has joined #ruby
jl- has joined #ruby
jl- has quit [Ping timeout: 244 seconds]
jpn has joined #ruby
jpn has quit [Ping timeout: 276 seconds]
Wra1th has quit [Quit: wra1th]
howdoi has quit [Quit: Connection closed for inactivity]
ua__ has joined #ruby
ua_ has quit [Ping timeout: 276 seconds]
ur5us has joined #ruby
roshanavand__ has joined #ruby
jpn has joined #ruby
Rounin has joined #ruby
teclator has joined #ruby
TomyWork has joined #ruby
bougyman_ has joined #ruby
shokohsc9 has joined #ruby
shokohsc has quit [Quit: Ping timeout (120 seconds)]
dionysus69 has quit [Remote host closed the connection]
dionysus69 has joined #ruby
Sankalp has joined #ruby
constxd has quit [Ping timeout: 244 seconds]
duds- has quit [Max SendQ exceeded]
jl- has joined #ruby
moldorcoder7_ has joined #ruby
moldorcoder7 has quit [Ping timeout: 240 seconds]
duds- has joined #ruby
Ziyan has quit [Ping timeout: 240 seconds]
jl- has quit [Ping timeout: 240 seconds]
Ziyan has joined #ruby
perrierjouet has quit [Quit: WeeChat 3.5]
perrierjouet has joined #ruby
Linux_Kerio has joined #ruby
<ox1eef>
i believe the original idea of the bang method was to indicate potential danger, but then it took on new meaning after that. modifying the receiver being one of them, but that's not always true - eg, it is Array#pop and not Array#pop!
roshanavand__ has quit [Ping timeout: 264 seconds]
duds- has quit [Max SendQ exceeded]
duds- has joined #ruby
Ziyan has quit [Ping timeout: 276 seconds]
Ziyan has joined #ruby
Ziyan_ has joined #ruby
Ziyan has quit [Ping timeout: 240 seconds]
Ziyan_ has quit [Ping timeout: 240 seconds]
duds- has quit [Max SendQ exceeded]
dionysus69 has quit [Remote host closed the connection]
dionysus69 has joined #ruby
duds- has joined #ruby
rvalue has quit [Ping timeout: 244 seconds]
rvalue has joined #ruby
twosuns has joined #ruby
twosuns is now known as proportions
duds- has quit [Max SendQ exceeded]
duds- has joined #ruby
Jonopoly has joined #ruby
duds- has quit [Max SendQ exceeded]
duds- has joined #ruby
_ht has joined #ruby
duds- has quit [Max SendQ exceeded]
jl- has joined #ruby
Ziyan has joined #ruby
jl- has quit [Ping timeout: 244 seconds]
duds- has joined #ruby
duds- has quit [Max SendQ exceeded]
duds- has joined #ruby
yxhuvud has quit [Read error: Connection reset by peer]
yxhuvud has joined #ruby
<ccooke>
There *is* a distinction there - there isn't exactly a version of pop that does not modify the receiver
<ccooke>
(also, modifying the receiver *definitely* seems in line with the "potential danger" meaning!)
Ziyan_ has joined #ruby
Ziyan has quit [Ping timeout: 244 seconds]
roshanavand has joined #ruby
<ox1eef>
sure, it's a hint to be careful more than a hint at mutation.
<ox1eef>
sometimes it is used to indicate an exception can be raised, like within rails - save, and save!
expectorants9 has joined #ruby
<ccooke>
it's a good convention to have. Coule be more promoted as "good practice", though
<ox1eef>
as long as there are two of the kind, a non-mutating call and a mutating call, then i agree.
<ccooke>
yeah. There could be a discussion for applying it to *all* mutating calls, but (while that *might* be a good thing) it would be a nasty language change at this point
jpn has quit [Ping timeout: 264 seconds]
howdoi has joined #ruby
<ox1eef>
agreed. i think it can be context-specific, and something to keep in mind.
duds- has quit [Max SendQ exceeded]
expectorants9 has quit [Remote host closed the connection]
roshanavand has quit [Remote host closed the connection]
<caleb>
I had started my own implementation of some concepts like GenServers and Supervisors
<caleb>
this is neat
swaggboi has joined #ruby
duds- has quit [Max SendQ exceeded]
duds- has joined #ruby
caleb_ has quit [Quit: leaving]
Ziyan_ has joined #ruby
duds- has quit [Max SendQ exceeded]
Ziyan has quit [Ping timeout: 244 seconds]
duds- has joined #ruby
Jonopoly has quit [Quit: WeeChat 3.0]
swaggboi has quit [Read error: Connection timed out]
Wra1th has joined #ruby
Wra1th has quit [Client Quit]
Guest73 has joined #ruby
<Guest73>
Hello, I have a question regarding Ruby on Rails params convention. I am building out a SPA like feature and I am using React. Is there any good reason why I should use the naming convention, i.e., { [model]: { attributes}} rather than just doing { attributes } and have a depth of 1 instead of 2?
duds- has quit [Max SendQ exceeded]
duds- has joined #ruby
Wra1th has joined #ruby
swaggboi has joined #ruby
Guest73 has quit [Quit: Client closed]
duds- has quit [Max SendQ exceeded]
Ziyan_ has quit [Ping timeout: 240 seconds]
duds- has joined #ruby
Ziyan has joined #ruby
bougyman_ is now known as bougyman
duds- has quit [Max SendQ exceeded]
<ox1eef>
params[:model] is useful because it avoids collision with things like params[:format].
jl- has joined #ruby
duds- has joined #ruby
jl- has quit [Ping timeout: 264 seconds]
swaggboi has quit [Read error: Connection timed out]
<havenwood>
I did a handle_info spike but am hung up on methods not being callable across the Ractor divide. I could detach the methods and set `nil` as the receiver, but that's the only way I can figure to get it to work with the current way Ractors work.
Rounin has quit [Ping timeout: 276 seconds]
duds- has quit [Max SendQ exceeded]
<havenwood>
caleb: I'm curious what your take on it is?
duds- has joined #ruby
lolja has quit [Remote host closed the connection]
lolja has joined #ruby
<havenwood>
Are you using Ractors?
duds- has quit [Max SendQ exceeded]
duds- has joined #ruby
Wra1th has left #ruby [#ruby]
jpn has quit [Quit: Lost terminal]
Wra1th has joined #ruby
Wra1th has quit [Quit: wra1th]
Linux_Kerio has quit [Ping timeout: 272 seconds]
jpn has joined #ruby
lolja has quit [Remote host closed the connection]
bastienleonard has quit [Ping timeout: 240 seconds]