adam12 changed the topic of #ruby to: Rules: https://ruby-community.com | Ruby 3.1.3, 3.0.5, 2.7.7: https://www.ruby-lang.org | Paste 4+ lines to: https://gist.github.com | Books: https://goo.gl/wpGhoQ | Logs: https://libera.irclog.whitequark.org/ruby/
infernix has quit [Ping timeout: 265 seconds]
eddof13 has quit [Quit: My MacBook Air has gone to sleep. ZZZzzz…]
infernix has joined #ruby
teclator has quit [Quit: http://quassel-irc.org - Chat comfortably. Anywhere.]
gonix has joined #ruby
Rounin has quit [Ping timeout: 248 seconds]
caedmon has joined #ruby
stirl has quit [Quit: stirl]
stirl has joined #ruby
caedmon has quit [Quit: caedmon]
caedmon has joined #ruby
caedmon has quit [Ping timeout: 246 seconds]
caedmon has joined #ruby
caedmon has quit [Client Quit]
caedmon has joined #ruby
stirl has quit [Ping timeout: 246 seconds]
grokify has joined #ruby
grokify has quit [Remote host closed the connection]
gonix has quit [Remote host closed the connection]
grokify has joined #ruby
grokify has quit [Remote host closed the connection]
Michaela has quit [Remote host closed the connection]
Michaela has joined #ruby
caedmon has quit [Ping timeout: 256 seconds]
caedmon has joined #ruby
grokify has joined #ruby
caedmon has quit [Quit: caedmon]
caedmon has joined #ruby
grokify has quit [Remote host closed the connection]
caedmon has quit [Quit: caedmon]
caedmon has joined #ruby
ur5us has quit [Ping timeout: 252 seconds]
grokify has joined #ruby
caedmon has quit [Ping timeout: 246 seconds]
grokify_ has joined #ruby
grokify has quit [Ping timeout: 252 seconds]
grokify_ has quit [Remote host closed the connection]
grokify has joined #ruby
grokify has quit [Remote host closed the connection]
grokify has joined #ruby
grokify has quit [Ping timeout: 252 seconds]
pandabot has quit [Quit: brb, add]
pandabot has joined #ruby
grokify has joined #ruby
grokify has quit [Remote host closed the connection]
desnudopenguino has quit [Ping timeout: 246 seconds]
grokify has joined #ruby
grokify has quit [Remote host closed the connection]
grokify has joined #ruby
grokify has quit [Remote host closed the connection]
pandabot has quit [Quit: you've been provisional for a long time now...]
pandabot has joined #ruby
grokify has joined #ruby
kaivai has quit [Quit: ZNC - https://znc.in]
otisolsen70 has joined #ruby
grokify_ has joined #ruby
havenwood6 has joined #ruby
justache- has joined #ruby
sphex_ has joined #ruby
pandabot_ has joined #ruby
acosta3 has joined #ruby
Spitfire_ has joined #ruby
quintasan_ has joined #ruby
yosafbridge` has joined #ruby
PedroG2 has joined #ruby
Jordan- has joined #ruby
balo_ has joined #ruby
cognemo_ has joined #ruby
kinduff_ has joined #ruby
pandabot has quit [Killed (NickServ (GHOST command used by pandabot_))]
pandabot_ is now known as pandabot
grokify has quit [*.net *.split]
infernix has quit [*.net *.split]
havenwood has quit [*.net *.split]
jetchisel has quit [*.net *.split]
sphex has quit [*.net *.split]
szkl has quit [*.net *.split]
kinduff has quit [*.net *.split]
balo has quit [*.net *.split]
wnd has quit [*.net *.split]
yosafbridge has quit [*.net *.split]
GvJordan has quit [*.net *.split]
acosta has quit [*.net *.split]
cognemo has quit [*.net *.split]
justache has quit [*.net *.split]
PedroG1 has quit [*.net *.split]
quintasan has quit [*.net *.split]
arahael has quit [*.net *.split]
Spitfire has quit [*.net *.split]
Fusl has quit [*.net *.split]
havenwood6 is now known as havenwood
acosta3 is now known as acosta
kinduff_ is now known as kinduff
grokify_ has quit [Remote host closed the connection]
arahael has joined #ruby
moldorcoder7 has joined #ruby
kaivai has joined #ruby
infernix has joined #ruby
Linux_Kerio has joined #ruby
dionysus69 has joined #ruby
FullMetalStacker has joined #ruby
Sankalp- has joined #ruby
Sankalp has quit [Ping timeout: 264 seconds]
Sankalp- is now known as Sankalp
wnd has joined #ruby
Fusl has joined #ruby
szkl has joined #ruby
jetchisel has joined #ruby
szkl has quit [Ping timeout: 263 seconds]
Furai has quit [Quit: WeeChat 3.7.1]
szkl has joined #ruby
teclator has joined #ruby
teclator_ has joined #ruby
teclator has quit [Client Quit]
teclator_ has quit [Client Quit]
Furai has joined #ruby
teclator has joined #ruby
otisolsen70 has quit [Quit: Leaving]
Rounin has joined #ruby
Rounin has quit [Changing host]
Rounin has joined #ruby
otisolsen70 has joined #ruby
___nick___ has joined #ruby
Sandlayth has left #ruby [WeeChat 3.0]
tumdum has joined #ruby
Linux_Kerio has quit [Ping timeout: 252 seconds]
Guest94 has joined #ruby
<cxl> Hi, I am struggling to use #order with Factorybot. I'd expect it to work since it comes with active record, but it fails with undefined method on the Factorybot model while running system tests.
<cxl> I hope I don't have to stub the order method, or do I?
<Guest94> Hi lovely folks :)  I've seen repeated use in our codebase of modules to add some methods to a class that aren't so much extending the functionality of the class as adding utilities / library methods that some method in the class privately depends on. My instinct is that, when possible, it'd be better to put those methods in a class with static
<Guest94> members instead of a module, avoiding potential name clashes and such. I'm not an experienced Rubyist, though, so I came here to ask what ya'll think.
<Guest94> I wish I had some concrete example to share, it'd make the discussion a bit less abstract. But on a high-level I'm wondering if there's a heavy bias towards modules in Ruby, or if it''s preferred to use classes with static members (in a FP-style), and then use modules when you truly need to extend the behaviour of a class
<jhass[m]> Guest94: This is basically what https://rubyapi.org/3.1/o/s?q=module_function exists for, so that you can choose between include MyUtils and MyUtils.foo per usage. An example of use of that in the standard library is the Math module
<Guest94> jhass[m]: oh I didn't know about this, thank you! So then I guess using moduels with module_function is preferred over classes with static members, since it offers more flexibility to the caller?
<jhass[m]> Yes indeed. Also I'd argue there's a semantic advantage, Class < Module, so a a module is to be preferred if you never intend to instantiate the type. Semantically classes are essentially a specialization of modules that allow them to be instantiated
<ox1eef_> module Foo; extend self; end is what I usually do.
<Guest94> Great, thank you both :)
<ox1eef_> Which is best depends on the context. 'extend self' will apply visibility rules to the singleton (static) methods as well.
jvalleroy has quit [Quit: https://quassel-irc.org - Chat comfortably. Anywhere.]
jvalleroy has joined #ruby
<cxl> Ok I've found my issue. I was trying to remove duplicate AR::Relation with #uniq, but that turns it into an array which doesn't have #order, etc. Is there an equivalent to #uniq for AR Relations?
Guest94 has quit [Quit: Client closed]
<jhass[m]> You might have luck with #distinct
mjacob_ has quit [Read error: Connection reset by peer]
c10l8 has joined #ruby
c10l has quit [Ping timeout: 264 seconds]
c10l8 is now known as c10l
mjacob has joined #ruby
Furai has quit [Quit: WeeChat 3.7.1]
Furai has joined #ruby
aeris has quit [Remote host closed the connection]
aeris has joined #ruby
cartdrige has joined #ruby
reset has quit [Quit: reset]
aeris has quit [Remote host closed the connection]
aeris has joined #ruby
tirnanog has quit [Quit: = ""]
aeris has quit [Remote host closed the connection]
gonix has joined #ruby
aeris has joined #ruby
perrierjouet has quit [Quit: WeeChat 3.7.1]
gonix has quit [Ping timeout: 256 seconds]
perrierjouet has joined #ruby
aeris has quit [Ping timeout: 255 seconds]
crax23 has joined #ruby
crax23 has quit [Remote host closed the connection]
crax23 has joined #ruby
aeris has joined #ruby
crax23 has quit [Max SendQ exceeded]
cartdrige has quit [Ping timeout: 260 seconds]
crax23 has joined #ruby
tumdum has quit [Ping timeout: 252 seconds]
tumdum has joined #ruby
mweckbecker has joined #ruby
crax23 has quit [Read error: Connection reset by peer]
cartdrige has joined #ruby
c10l has quit [Ping timeout: 256 seconds]
crax23 has joined #ruby
cartdrige has quit [Ping timeout: 260 seconds]
Y05hito__ has joined #ruby
crax23 has quit [Ping timeout: 246 seconds]
c10l has joined #ruby
Y05hito__ has quit [Client Quit]
cartdrige has joined #ruby
crax23 has joined #ruby
dionysus69 has quit [Quit: dionysus69]
cartdrige has quit [Ping timeout: 256 seconds]
dionysus69 has joined #ruby
gonix has joined #ruby
gonix has quit [Ping timeout: 260 seconds]
Y05hito__ has joined #ruby
cartdrige has joined #ruby
crax23 has quit [Read error: Connection reset by peer]
Y05hito__ has quit [Ping timeout: 252 seconds]
crax23 has joined #ruby
cartdrige has quit [Ping timeout: 252 seconds]
Linux_Kerio has joined #ruby
aeris has quit [Remote host closed the connection]
aeris has joined #ruby
FullMetalStacker has quit [Remote host closed the connection]
some14u has joined #ruby
caedmon has joined #ruby
FullMetalStacker has joined #ruby
m_antis has quit [Ping timeout: 246 seconds]
some14u has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
grokify has joined #ruby
eddof13 has joined #ruby
FullMetalStacker has quit [Remote host closed the connection]
eddof13 has quit [Client Quit]
Guest71 has joined #ruby
Guest71 has quit [Client Quit]
aeris has quit [Ping timeout: 255 seconds]
aeris has joined #ruby
some14u has joined #ruby
grokify has quit [Remote host closed the connection]
grokify has joined #ruby
aeris has quit [Remote host closed the connection]
aeris has joined #ruby
some14u has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
grokify has quit [Remote host closed the connection]
grokify has joined #ruby
grokify has quit [Ping timeout: 256 seconds]
grokify has joined #ruby
grokify has quit [Remote host closed the connection]
FullMetalStacker has joined #ruby
grokify has joined #ruby
grokify has quit [Ping timeout: 256 seconds]
desnudopenguino has joined #ruby
FullMetalStacker has quit [Remote host closed the connection]
FullMetalStacker has joined #ruby
cartdrige has joined #ruby
crax23 has quit [Ping timeout: 256 seconds]
justache- is now known as justache
grokify has joined #ruby
m_antis has joined #ruby
grokify has quit [Ping timeout: 256 seconds]
grokify has joined #ruby
grokify has quit [Remote host closed the connection]
grokify has joined #ruby
aeris has quit [Remote host closed the connection]
aeris has joined #ruby
some14u has joined #ruby
some14u has quit [Read error: Connection reset by peer]
some14u has joined #ruby
FetidToot0 has joined #ruby
FetidToot has quit [Ping timeout: 260 seconds]
FetidToot0 is now known as FetidToot
some14u has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Laplace has joined #ruby
<Laplace> Hi -- I can write a class which accepts a block in the initialize method to then do instance_eval. However, is there an alternative way to do this in situations when we cannot change the initialize method?
<cartdrige> yes, just do a normal function and call it from the std namespace lol :]
<cartdrige> there's no such situation, why couldn't you have an initializer?
FetidToot has quit [Quit: Ping timeout (120 seconds)]
FetidToot has joined #ruby
FetidToot has quit [Client Quit]
FetidToot has joined #ruby
<adam12> Laplace: but you want it to occur with SomeClass.new?
Linux_Kerio has quit [Ping timeout: 256 seconds]
grokify has quit [Remote host closed the connection]
spinningCat has quit [Remote host closed the connection]
<Laplace> adam12: It would be nice if I could without changing changing the init method
<Laplace> I am using a Sorbet struct class which implicitly does the initialize definition
<adam12> Laplace: Well, two workarounds: define your own .new :) or make your own constructor like .build which calls instance = new; instance.instance_eval
<Laplace> Yup, no fancy hacks here
<Laplace> I think doing initialize and super would befine
tumdum has quit [Ping timeout: 260 seconds]
tirnanog has joined #ruby
tumdum has joined #ruby
grokify_ has joined #ruby
cartdrige has quit [Quit: Leaving]
grokify_ has quit [Ping timeout: 256 seconds]
grokify has joined #ruby
grokify has quit [Remote host closed the connection]
grokify has joined #ruby
ur5us has joined #ruby
some14u has joined #ruby
___nick___ has quit [Quit: https://quassel-irc.org - Chat comfortably. Anywhere.]
grokify has quit [Ping timeout: 256 seconds]
some14u has quit [Client Quit]
___nick___ has joined #ruby
___nick___ has quit [Client Quit]
grokify has joined #ruby
___nick___ has joined #ruby
llua has quit [Quit: <Rudolph> shell code is what greycat reads to kids when he tucks them in]
grokify has quit [Ping timeout: 246 seconds]
llua has joined #ruby
Sankalp has quit [Ping timeout: 252 seconds]
_ht has joined #ruby
caedmon has quit [Ping timeout: 252 seconds]
llua has quit [Ping timeout: 256 seconds]
Sankalp has joined #ruby
llua has joined #ruby
___nick___ has quit [Ping timeout: 268 seconds]
cartdrige has joined #ruby
reset has joined #ruby
llua has quit [Ping timeout: 246 seconds]
grokify has joined #ruby
_ht has quit [Remote host closed the connection]
llua has joined #ruby
grokify has quit [Ping timeout: 268 seconds]
some14u has joined #ruby
some14u has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
some14u has joined #ruby
grokify has joined #ruby
otisolsen70 has quit [Quit: Leaving]
grokify has quit [Remote host closed the connection]
dionysus69 has quit [Ping timeout: 256 seconds]
<adam12> caleb: you moving on from $??
some14u has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<caleb> adam12: got fired actually
<caleb> the long version is this
<caleb> I turned down the initial offer because I didn't like the manager of the team I'd be on. So they hooked me up with this new team and we really hit it off. Took the job, manager left after 2 months for unrelated reasons after being there 8 years.
grokify has joined #ruby
<caleb> I'm not sure how much I'm allowed to say and still get my severance but I'll just say I struggled to succeed in that environment and during impact reviews I didn't make the cut to stay.
<adam12> caleb: that sucks :|
grokify has quit [Remote host closed the connection]
some14u has joined #ruby
grokify has joined #ruby
grokify has quit [Ping timeout: 268 seconds]
ruby[bot] has quit [Remote host closed the connection]
ruby[bot] has joined #ruby
some14u has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<caleb> hmm looks like a silent layoff
<caleb> 200+ let go today
<caleb> that makes me feel better
teclator has quit [Quit: http://quassel-irc.org - Chat comfortably. Anywhere.]
hightower2 has joined #ruby
hightower2 has quit [Remote host closed the connection]
hightower2 has joined #ruby
Starfoxxes has quit [Ping timeout: 248 seconds]
moldorcoder7 has quit [Ping timeout: 268 seconds]
FullMetalStacker has quit [Remote host closed the connection]