havenwood changed the topic of #ruby to: Rules & more: https://ruby-community.com | Ruby 2.6.5, 2.5.7, 2.7.0-preview3: https://www.ruby-lang.org | Paste 4+ lines of text to https://dpaste.de/ and select Ruby as the language | Rails questions? Ask in #RubyOnRails | Books: https://goo.gl/wpGhoQ | Logs: https://irclog.whitequark.org/ruby | Can't talk? Register/identify with Nickserv first!
RiPuk has quit [Ping timeout: 268 seconds]
AJA4350 has quit [Ping timeout: 240 seconds]
AJA4350 has joined #ruby
sergioro has joined #ruby
JohanP has joined #ruby
linetrace has left #ruby [#ruby]
JohanP has quit [Ping timeout: 276 seconds]
caduguedess has joined #ruby
poontangmessiah has joined #ruby
poontangmessiah has quit [Remote host closed the connection]
poontangmessiah has joined #ruby
tsrt^ has joined #ruby
wymillerlinux has joined #ruby
NODE has quit [Quit: Benett]
akemhp_ has joined #ruby
akemhp has quit [Ping timeout: 246 seconds]
NODE has joined #ruby
NODE has quit [Client Quit]
NODE has joined #ruby
AJA4350 has quit [Ping timeout: 240 seconds]
AJA4350 has joined #ruby
poontangmessiah has quit [Ping timeout: 276 seconds]
NODE has quit []
Benett has quit [Quit:  ]
Technodrome has joined #ruby
Benett has joined #ruby
NODE has joined #ruby
TCZ has joined #ruby
s2013 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
xall has joined #ruby
spiette has quit [Quit: ZNC 1.7.5 - https://znc.in]
noizex has joined #ruby
<caduguedess> I've seen some Gemfiles using " around gems and another Gemfiles using ' around gems.
<caduguedess> Are " and ' the same thing for Gemfiles?
<mkroman> yes, it's just ruby code
cow[moo] has joined #ruby
AJA4351 has joined #ruby
<caduguedess> But can I put in the same Gemfile gems with " " and gems with ' ' ?
<caduguedess> I got a Gemfile with this and I'm wondering if it may cause trouble
AJA4350 has quit [Ping timeout: 240 seconds]
AJA4351 is now known as AJA4350
poontangmessiah has joined #ruby
<adam12> caduguedess: It will work fine but settling on one is nice. I prefer double quotes everywhere in my Ruby projects.
gearnode has joined #ruby
chalkmonster has joined #ruby
charon77 has joined #ruby
akem__ has joined #ruby
akemhp_ has quit [Ping timeout: 250 seconds]
dasher00 has quit [Ping timeout: 240 seconds]
dasher00 has joined #ruby
caduguedess has quit [Quit: Leaving.]
AJA4350 has quit [Ping timeout: 268 seconds]
NODE has quit [Quit: changing servers]
sameerynho has quit [Ping timeout: 250 seconds]
NODE has joined #ruby
JohanP has joined #ruby
AJA4350 has joined #ruby
akemhp_ has joined #ruby
akemhp_ has quit [Remote host closed the connection]
akemhp has joined #ruby
akem__ has quit [Ping timeout: 240 seconds]
JohanP has quit [Ping timeout: 265 seconds]
cow[moo] has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
_whitelogger has joined #ruby
bruce_lee has quit [Remote host closed the connection]
TCZ has quit [Quit: Bye Bye]
donofrio_ has quit [Read error: Connection reset by peer]
donofrio_ has joined #ruby
AJA4350 has quit [Ping timeout: 265 seconds]
AJA4350 has joined #ruby
<sergioro> q
sergioro has quit [Quit: leaving]
akemhp_ has joined #ruby
akemhp has quit [Ping timeout: 268 seconds]
charon77 has quit [Quit: WeeChat 2.6]
JohanP has joined #ruby
JohanP has quit [Ping timeout: 250 seconds]
wymillerlinux has quit [Quit: wymillerlinux]
wymillerlinux has joined #ruby
chalkmonster has quit [Ping timeout: 240 seconds]
chalkmonster has joined #ruby
wildtrees has quit [Quit: Leaving]
Technodrome has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
AJA4350 has quit [Remote host closed the connection]
Creatornator has joined #ruby
Guest14610 has joined #ruby
<Guest14610> hihi
envex has joined #ruby
goepsilongo has joined #ruby
Guest14610 has quit [Remote host closed the connection]
goepsilongo has left #ruby [#ruby]
cthulchu has quit [Read error: Connection reset by peer]
cthulchu has joined #ruby
xall has quit [Ping timeout: 268 seconds]
gix has quit [Ping timeout: 276 seconds]
Nicmavr has quit [Read error: Connection reset by peer]
cthulchu has quit [Read error: Connection reset by peer]
cthulchu has joined #ruby
Nicmavr has joined #ruby
duderonomy has joined #ruby
wymillerlinux has quit [Remote host closed the connection]
codic_ has joined #ruby
sergioro has joined #ruby
<codic_> Hey
xall has joined #ruby
itarato has joined #ruby
bitwinery has quit [Quit: Leaving]
<havenwood> codic_: hi
<codic_> :p
<uplime> adam12: same here. its a shame that i have to disable the warning in rubocop
<codic_> check out my new project
akemhp_ has quit [Ping timeout: 240 seconds]
<havenwood> &>> 6.upto(7).map { |n| ((2*n-3-(-1)**n)*(22*n**2-21*n+5*n*(-1)**n)/96).chr }.join
<rubydoc> # => ":p" (https://carc.in/#/r/85tl)
<havenwood> codic_: Congrats on the project.
<codic_> Thank you
<codic_> Any suggestions?
<havenwood> codic_: I'm creeped out by "Your name is Adolf H..."
<codic_> Lol
rwb has quit [Ping timeout: 265 seconds]
<havenwood> codic_: Reading this code, I think it's in poor taste at the least.
<codic_> Alright, any examples on what can be improved havenwood?
<havenwood> codic_: I won't suggest improvements for a game about pretending to be Hitler. I do have code suggestions if you have cost that isn't fascist.
<havenwood> codic_: For this code I'm just inclined to report you to GitLab and ban you from the channel.
<codic_> For what? I created it purely as an example based on true events...
<codic_> havenwood: But alright, if it's offensive, it can be removed
<codic_> Um
<havenwood> codic_: I'd be very happy to review code if you have a game that doesn't involve pretending to be a Nazi.
<codic_> Okay... I'll remove it? 😕️
<codic_> Well, sure
<codic_> i'll make a new one
<codic_> Get back to you
Mrbuck has joined #ruby
chalkmon1 has joined #ruby
Technodrome has joined #ruby
chalkmonster has quit [Ping timeout: 276 seconds]
chalkmon1 has quit [Client Quit]
<codic_> Very small game as I'm sleepy, don't have much ideas
<havenwood> codic_: If you have a bunch of if statements around the same value, consider a case statement.
<codic_> What's that? Sorry, new to Ruby. looking it up
<codic_> is it like the c one?
<codic_> the switch/case havenwood
<havenwood> codic_: The code looks to be on the right track. I'd suggest exercism for code challenges: https://exercism.io/
<havenwood> codic_: The Ruby case doesn't fall through.
<codic_> Thanks!
<codic_> will refactor
<codic_> havenwood: any other ideas?
xall has quit [Ping timeout: 252 seconds]
<havenwood> codic_: `gets.chomp` is 100% a String, so the `.to_s` isn't needed.
romanblanco has joined #ruby
poontangmessiah_ has joined #ruby
<codic_> Thanks! Finally, does ruby case support strings?
<codic_> cause c++'s doesnt
poontangmessiah has quit [Ping timeout: 276 seconds]
<havenwood> codic_: It'd be better to declare `aval` before the loop, since it's creating a new array each iteration as written.
<havenwood> codic_: Yes, Ruby case supports all Objects.
<codic_> Nice
<havenwood> codic_: Instead of `x != true` use `!x` (line 7).
<havenwood> codic_: Or in this case: unless aval.include(doitem)
<codic_> Oh I was trying to do that
<codic_> isnt it 'include?'
<codic_> Well I'll refactor thanks
codic_ has quit [Quit: codic_]
<havenwood> yes, include?
<havenwood> my typo
phaul has quit [Ping timeout: 268 seconds]
poontangmessiah_ has quit [Quit: Leaving]
bvdw has quit [Read error: Connection reset by peer]
bvdw has joined #ruby
phaul has joined #ruby
Creatornator has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
phaul has quit [Ping timeout: 250 seconds]
phaul has joined #ruby
candlebag has quit [Ping timeout: 252 seconds]
davispuh has quit [Quit: http://quassel-irc.org - Chat comfortably. Anywhere.]
phaul has quit [Ping timeout: 268 seconds]
Creatornator has joined #ruby
jenrzzz has joined #ruby
phaul has joined #ruby
phaul has quit [Ping timeout: 250 seconds]
hutch1 has quit [Ping timeout: 250 seconds]
Mrbuck has quit [Remote host closed the connection]
phaul has joined #ruby
phaul has quit [Ping timeout: 265 seconds]
phaul has joined #ruby
Technodrome has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
phaul has quit [Ping timeout: 276 seconds]
phaul has joined #ruby
phaul has quit [Ping timeout: 250 seconds]
phaul has joined #ruby
itarato has quit [Ping timeout: 265 seconds]
Creatornator has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
phaul has quit [Ping timeout: 265 seconds]
phaul has joined #ruby
romanblanco has quit [Ping timeout: 265 seconds]
phaul has quit [Ping timeout: 268 seconds]
phaul has joined #ruby
phaul has quit [Ping timeout: 268 seconds]
phaul has joined #ruby
houhoulis has joined #ruby
phaul has quit [Ping timeout: 252 seconds]
phaul has joined #ruby
phaul has quit [Ping timeout: 265 seconds]
phaul has joined #ruby
Technodrome has joined #ruby
Slanoti has joined #ruby
jenrzzz has quit [Ping timeout: 245 seconds]
jenrzzz has joined #ruby
llua has quit [Quit: <Rudolph> shell code is what greycat reads to kids when he tucks them in]
llua has joined #ruby
infinityfye has joined #ruby
gigetoo has quit [Ping timeout: 240 seconds]
gigetoo has joined #ruby
jenrzzz has quit [Ping timeout: 265 seconds]
cow[moo] has joined #ruby
_whitelogger has joined #ruby
gix has joined #ruby
infinityfye has quit [Remote host closed the connection]
infinityfye has joined #ruby
suukim has joined #ruby
gigetoo has quit [Ping timeout: 265 seconds]
infinityfye has quit [Remote host closed the connection]
infinityfye has joined #ruby
gigetoo has joined #ruby
jenrzzz has joined #ruby
infinityfye has quit [Remote host closed the connection]
infinityfye has joined #ruby
infinityfye has quit [Remote host closed the connection]
infinityfye has joined #ruby
infinityfye has quit [Remote host closed the connection]
jenrzzz has quit [Ping timeout: 265 seconds]
rippa has joined #ruby
MrCrackPot has quit [Quit: Leaving]
claudiuinberlin has joined #ruby
infinityfye has joined #ruby
infinityfye has quit [Remote host closed the connection]
infinityfye has joined #ruby
infinityfye has quit [Remote host closed the connection]
infinityfye has joined #ruby
romanblanco has joined #ruby
skx86 has quit [Quit: Connection closed for inactivity]
houhoulis has quit [Remote host closed the connection]
romanblanco has quit [Ping timeout: 268 seconds]
NODE has quit [Quit: changing servers]
im0nde has joined #ruby
im0nde_ has quit [Ping timeout: 246 seconds]
NODE has joined #ruby
NODE has quit [Client Quit]
NODE has joined #ruby
sergioro has quit [Quit: leaving]
NODE has quit [Client Quit]
NODE has joined #ruby
NODE has quit [Client Quit]
NODE has joined #ruby
cthulchu has quit [Read error: Connection reset by peer]
cthulchu has joined #ruby
xall has joined #ruby
cthulchu has quit [Read error: Connection reset by peer]
cthulchu has joined #ruby
Fernando-Basso has joined #ruby
infinityfye_ has joined #ruby
infinityfye has quit [Ping timeout: 240 seconds]
infinityfye has joined #ruby
infinityfye_ has quit [Ping timeout: 240 seconds]
jenrzzz has joined #ruby
jenrzzz has quit [Ping timeout: 276 seconds]
Technodrome has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
DTZUZO has quit [Ping timeout: 240 seconds]
MrCrackPot has joined #ruby
chalkmonster has joined #ruby
xall has quit [Quit: xall]
DTZUZO has joined #ruby
gearnode has quit [Quit: WeeChat 2.5]
gearnode has joined #ruby
gearnode has left #ruby [#ruby]
NODE has quit [Quit: changing servers]
NODE has joined #ruby
gearnode has joined #ruby
tsujp has joined #ruby
DTZUZO has quit [Ping timeout: 252 seconds]
claudiuinberlin has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Slanoti has quit [Quit: Leaving]
DTZUZO has joined #ruby
jenrzzz has joined #ruby
DTZUZO has quit [Ping timeout: 240 seconds]
jenrzzz has quit [Ping timeout: 250 seconds]
darris has quit [Quit: Bye bye!]
darris_ has joined #ruby
darris_ is now known as darris
DTZUZO has joined #ruby
DTZUZO has quit [Ping timeout: 250 seconds]
chalkmonster has quit [Quit: WeeChat 2.6]
DTZUZO has joined #ruby
DTZUZO has quit [Ping timeout: 245 seconds]
kent\n has quit [Ping timeout: 276 seconds]
Technodrome has joined #ruby
kent\n has joined #ruby
bvdw has quit [Read error: Connection reset by peer]
bvdw has joined #ruby
DTZUZO has joined #ruby
DTZUZO has quit [Ping timeout: 252 seconds]
tsujp has quit [Ping timeout: 240 seconds]
entel has joined #ruby
DTZUZO has joined #ruby
DTZUZO has quit [Ping timeout: 240 seconds]
DTZUZO has joined #ruby
_whitelogger has joined #ruby
DTZUZO has quit [Ping timeout: 265 seconds]
DTZUZO has joined #ruby
iNs has quit [Remote host closed the connection]
iNs has joined #ruby
DTZUZO has quit [Ping timeout: 240 seconds]
DTZUZO has joined #ruby
DTZUZO has quit [Ping timeout: 265 seconds]
tsujp has joined #ruby
DTZUZO has joined #ruby
DTZUZO has quit [Ping timeout: 240 seconds]
claudiuinberlin has joined #ruby
sh7d_ has joined #ruby
sh7d has quit [Ping timeout: 268 seconds]
rapha has quit [Quit: rebooting the world]
jenrzzz has joined #ruby
chunkypuffs has quit [Read error: Connection reset by peer]
donofrio__ has joined #ruby
donofrio_ has quit [Ping timeout: 252 seconds]
IsoLinCHiP has quit [Ping timeout: 240 seconds]
jenrzzz has quit [Ping timeout: 240 seconds]
AJA4350 has joined #ruby
chunkypuffs has joined #ruby
NODE has quit [Quit: changing servers]
NODE has joined #ruby
Technodrome has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
TCZ has joined #ruby
TCZ has quit [Client Quit]
al2o3-cr has quit [Ping timeout: 260 seconds]
howaboutyes has joined #ruby
al2o3-cr has joined #ruby
ua has quit [Ping timeout: 240 seconds]
DTZUZO has joined #ruby
IsoLinCHiP has joined #ruby
llua has quit [Quit: <Rudolph> shell code is what greycat reads to kids when he tucks them in]
rwb has joined #ruby
llua has joined #ruby
perlsyntax has joined #ruby
<perlsyntax> Hi
ua has joined #ruby
al2o3-cr has quit [Remote host closed the connection]
hiroaki has joined #ruby
MrCrackPot has quit [Remote host closed the connection]
MrCrackPot has joined #ruby
MrCrackPot has quit [Remote host closed the connection]
MrCrackPot has joined #ruby
AJA4351 has joined #ruby
lucasb has joined #ruby
AJA4350 has quit [Ping timeout: 276 seconds]
AJA4351 is now known as AJA4350
hiroaki has quit [Ping timeout: 268 seconds]
hiroaki has joined #ruby
perlsyntax has quit [Remote host closed the connection]
NODE has quit [Quit: changing servers]
NODE has joined #ruby
Nicmavr has quit [Read error: Connection reset by peer]
Nicmavr has joined #ruby
al2o3-cr has joined #ruby
cow[moo] has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
cow[moo] has joined #ruby
jenrzzz has joined #ruby
jenrzzz has quit [Ping timeout: 240 seconds]
cow[moo] has quit [Ping timeout: 245 seconds]
davispuh has joined #ruby
howaboutyes has quit [Quit: Leaving]
AJA4351 has joined #ruby
AJA4350 has quit [Ping timeout: 276 seconds]
AJA4351 is now known as AJA4350
codic__ has joined #ruby
Boko_dcdca has joined #ruby
<codic__> Hey
sauvin has quit [K-Lined]
Boko_dcdca has quit [Write error: Connection reset by peer]
Boko_cdbec has joined #ruby
Boko_cdbec has quit [Read error: Connection reset by peer]
<gearnode> Hello
Boko_aaeca has joined #ruby
Boko_aaeca has quit [Write error: Connection reset by peer]
Boko_ecbae has joined #ruby
codic__ has quit [Quit: codic__]
<havenwood> Hi
Boko_ecbae has quit [Write error: Connection reset by peer]
ctOS has joined #ruby
Boko_ddaab has joined #ruby
Boko_ddaab has quit [Write error: Connection reset by peer]
Boko_cdedd has joined #ruby
Boko_cdedd has quit [Write error: Connection reset by peer]
infinityfye has quit [Quit: Leaving]
ellcs has joined #ruby
Boko_abedc has joined #ruby
_phaul has joined #ruby
phaul has quit [Ping timeout: 240 seconds]
Boko_abedc has quit [Write error: Connection reset by peer]
AJA4351 has joined #ruby
AJA4350 has quit [Ping timeout: 250 seconds]
AJA4351 is now known as AJA4350
_phaul has quit [Ping timeout: 265 seconds]
_phaul has joined #ruby
candlebag has joined #ruby
MrCrackPot has quit [Quit: Leaving]
NODE has quit [Quit: changing servers]
zapata has quit [Quit: WeeChat 2.6]
NODE has joined #ruby
_phaul has quit [Ping timeout: 240 seconds]
ology has joined #ruby
_phaul has joined #ruby
ruskie has quit [Quit: ...]
_phaul has quit [Ping timeout: 265 seconds]
Boko_deada has joined #ruby
_phaul has joined #ruby
Boko_deada has quit [Write error: Connection reset by peer]
yokel has quit [Ping timeout: 252 seconds]
_phaul has quit [Ping timeout: 245 seconds]
akemhp has joined #ruby
zapata has joined #ruby
yokel has joined #ruby
dinfuehr has quit [Ping timeout: 268 seconds]
dinfuehr has joined #ruby
_phaul has joined #ruby
Boko_dabce has joined #ruby
Boko_dabce has quit [Read error: Connection reset by peer]
jenrzzz has joined #ruby
_phaul has quit [Ping timeout: 276 seconds]
Boko_debac has joined #ruby
_phaul has joined #ruby
jenrzzz has quit [Ping timeout: 250 seconds]
dinfuehr has quit [Ping timeout: 250 seconds]
_phaul has quit [Ping timeout: 240 seconds]
ellcs has quit [Ping timeout: 240 seconds]
Boko_debac has quit [Read error: Connection reset by peer]
dinfuehr has joined #ruby
_phaul has joined #ruby
dinfuehr_ has joined #ruby
dinfuehr has quit [Ping timeout: 240 seconds]
_phaul has quit [Ping timeout: 265 seconds]
_phaul has joined #ruby
hutch1 has joined #ruby
dinfuehr_ has quit [Ping timeout: 240 seconds]
dinfuehr has joined #ruby
_phaul has quit [Ping timeout: 276 seconds]
dinfuehr has quit [Ping timeout: 240 seconds]
_phaul has joined #ruby
bvdw has quit [Read error: Connection reset by peer]
dinfuehr has joined #ruby
bvdw has joined #ruby
_phaul has quit [Ping timeout: 276 seconds]
dinfuehr_ has joined #ruby
Emmanuel_Chanel has quit [Ping timeout: 240 seconds]
sh7d_ has quit [Quit: meh]
dinfuehr has quit [Ping timeout: 268 seconds]
sh7d has joined #ruby
_phaul has joined #ruby
ruskie has joined #ruby
dinfuehr_ has quit [Ping timeout: 245 seconds]
_phaul has quit [Ping timeout: 265 seconds]
dinfuehr has joined #ruby
NODE has quit [Quit: changing servers]
NODE has joined #ruby
_phaul has joined #ruby
NODE has quit [Client Quit]
NODE has joined #ruby
johnny56 has quit [Remote host closed the connection]
NODE has quit [Client Quit]
TzilTzal has joined #ruby
<TzilTzal> Hi
_phaul has quit [Ping timeout: 265 seconds]
<TzilTzal> Is there a difference invoking a method (inside another method) when qualigying it with self?
NODE has joined #ruby
<TzilTzal> i.e.: is there a difference between self.foo and foo when invoked from an instance method?
dinfuehr has quit [Ping timeout: 245 seconds]
fphilipe_ has joined #ruby
<havenwood> TzilTzal: The `self` is already the implicit receiver. The main time you run into a difference is when using a setter method with equal sign syntactic sugar.
<havenwood> TzilTzal: For example, `foo = 42` assigns a local variable but `self.foo = 42` calls a #foo= setter method.
_phaul has joined #ruby
<TzilTzal> fair enough. But otherwise, there shouldn't be one, right?
<TzilTzal> I just see a lot of code that invokes "self.obj.foo(....)" even though there's an attr_reader for obj
<TzilTzal> so was wonder if there would be a difference at all.
itarato has joined #ruby
dinfuehr has joined #ruby
<havenwood> TzilTzal: There are a few edge case bugs around private method usage with self. One was just patched fairly recently: https://bugs.ruby-lang.org/issues/16123
<havenwood> TzilTzal: That said, you can typically assume there isn't a difference.
<TzilTzal> So is it safer to use self. or without it?
<havenwood> TzilTzal: Folk just code wildly inconsistently. I'd recommend omitting `self` unless you have a reason to explicitly use it.
<havenwood> TzilTzal: I prefer to access @instance_variables directly and use `self` only when it matters.
<TzilTzal> So do I, but I see a lot of 'self.' in the code (at work) where I think it's redundant.
_phaul has quit [Ping timeout: 265 seconds]
<havenwood> TzilTzal: It sounds like you're right. It's probably redundant and unnecessary usage.
<TzilTzal> Asking cause I'm new to Ruby... so not totally sure.
<TzilTzal> Thanks for your help.
<havenwood> No prob, any time.
<havenwood> TzilTzal: To be clear, if there's an attr_reader for obj, I'd actually use `@obj` rather than `self.obj` or `obj` internally.
<havenwood> TzilTzal: @obj is both faster and communicates the simplest case to subsequent readers.
<TzilTzal> Yes, that's what I do and prefer.
<havenwood> Calling a method is slow compared to getting an instance variable.
<TzilTzal> But I see a lot of it done through self. Also, I see less care for things like attr_reader/writer vs. attr_accessor. Seems as though most just place everything under attr_accessor.
<havenwood> Getting an instance variable immediately informs the reader there won't be side effects and there's then no need to check the method definition.
<havenwood> `@obj =` and `@obj` are better than `self.obj =` and `obj`.
<TzilTzal> that's what I'd expect.
<TzilTzal> I was referring though to thinks like design & accessibility when mentioning attr_reader vs. attr_accessor
<havenwood> TzilTzal: If it's Rails... you're going to see a lot of `self.foo. =` but those aren't just instance variables.
Ai9zO5AP has joined #ruby
<TzilTzal> what are they then?
<havenwood> But yeah, for Ruby, just get and set instance variables directly.
<havenwood> TzilTzal: ActiveRecord columns.
<TzilTzal> So why are they qualified with self in this case?
<havenwood> TzilTzal: In case of ActiveRecord?
<havenwood> With ActiveRecord, you really are using a setter method.
itarato has quit [Quit: Konversation terminated!]
<TzilTzal> Yes.. what you're referring to that these aren't instance variable.
<TzilTzal> s
<havenwood> Yup
<havenwood> Yeah, for instance variables, use them directly - period.
Boko_edeea has joined #ruby
<TzilTzal> havenwood: you're saying with Rails you have to use a setter method?
<havenwood> TzilTzal: I mean you *can* avoid it, but the common pattern is to use `self.foo =`.
<TzilTzal> ok, fair enough.
<havenwood> TzilTzal: Here's a good example of proper usage in Rails for two good reasons: https://github.com/discourse/discourse/blob/888e68a1637ca784a7bf51a6bbb524dcf7413b13/app/models/concerns/positionable.rb#L8
<havenwood> TzilTzal: #position= is a setter method, being used by ||= here.
<havenwood> TzilTzal: So, `self.`. is proper.
_phaul has joined #ruby
<havenwood> TzilTzal: And `class` is a method on Kernel, so we need to `self.class` as well.
<TzilTzal> So @position would even fail in this case, no?
<TzilTzal> Why not @@ then?
<havenwood> TzilTzal: This is an ActiveRecord model, so there's o @position instance variable involved.
<havenwood> no*
<havenwood> TzilTzal: My advice to you would be to pretend @@class_instance_variables don't exist.
<havenwood> TzilTzal: And never set your own $global_variable either.
<TzilTzal> Yeah, just read about it all a few days ago. Still a bit confusing.
<havenwood> TzilTzal: Just use constants, local variables and instance variables.
<TzilTzal> I do... as well as class variables when needed.
<TzilTzal> (yeah, I know they're still instance variables of the singleton class)
Boko_edeea has quit [Read error: Connection reset by peer]
<havenwood> TzilTzal: It's an antipattern to make your own class or global variables.
<TzilTzal> What do you mean to make your own class?
<havenwood> TzilTzal: If you have a single instance of state, use a Singleton Class. Singleton is one lib matz maintains himself.
<havenwood> TzilTzal: No state, use a module. One instance of state, use a singleton. Multiple, a class.
_phaul has quit [Ping timeout: 252 seconds]
<TzilTzal> I'm not referring to an actual Singleton ... I don't use this pattern, actually since it's also an anti-pattern.
<TzilTzal> I was referring to the Ruby singleton class where class methods resides.
jenrzzz has joined #ruby
<havenwood> TzilTzal: Yes, from time to time there's actually a reason to store state on a class or module itself. I see that done haphazardly more often than purposefully though.
<havenwood> It's a nice tool to have, for when there's a good reason.
<havenwood> TzilTzal: Here's an example showing how to put state in a module: https://gist.github.com/havenwood/ae6fe35b5d006358c81ad6c3b99c6b21
sauvin has joined #ruby
<havenwood> A bit of an odd case, but can be handy.
NODE has quit [Quit: changing servers]
Fernando-Basso has quit [Quit: Leaving]
Mrbuck has joined #ruby
jenrzzz has quit [Ping timeout: 250 seconds]
NODE has joined #ruby
dinfuehr has quit [Ping timeout: 276 seconds]
NODE has quit [Client Quit]
ellcs has joined #ruby
NODE has joined #ruby
Boko_bbbde has joined #ruby
NODE has quit [Client Quit]
Technodrome has joined #ruby
NODE has joined #ruby
Boko_bbbde has quit [Read error: Connection reset by peer]
cthulchu has quit [Read error: Connection reset by peer]
cthulchu has joined #ruby
dinfuehr has joined #ruby
_phaul has joined #ruby
Boko_aeadc has joined #ruby
jenrzzz has joined #ruby
_phaul has quit [Ping timeout: 250 seconds]
Mrbuck has quit [Remote host closed the connection]
_phaul has joined #ruby
jenrzzz has quit [Ping timeout: 252 seconds]
Boko_aeadc has quit [Read error: Connection reset by peer]
sameerynho has joined #ruby
brool has joined #ruby
Boko_aaddd has joined #ruby
Boko_aaddd has quit [Write error: Connection reset by peer]
_phaul has quit [Quit: :wq]
phaul has joined #ruby
Creatornator has joined #ruby
houhoulis has joined #ruby
ur5us has joined #ruby
phaul has quit [Ping timeout: 246 seconds]
Emmanuel_Chanel has joined #ruby
phaul has joined #ruby
sauvin_ has joined #ruby
dellavg has joined #ruby
phaul has quit [Ping timeout: 250 seconds]
dellavg has quit [Remote host closed the connection]
BTRE has quit [Ping timeout: 276 seconds]
NODE has quit [Quit: changing servers]
sauvin has quit [Ping timeout: 268 seconds]
sauvin_ is now known as sauvin
NODE has joined #ruby
ur5us has quit [Ping timeout: 250 seconds]
hutch1 has quit [Ping timeout: 265 seconds]
NODE has quit [Client Quit]
phaul has joined #ruby
RiPuk has joined #ruby
NODE has joined #ruby
SeepingN has quit [Quit: The system is going down for reboot NOW!]
phaul has quit [Ping timeout: 250 seconds]
phaul has joined #ruby
chalkmonster has joined #ruby
ellcs has quit [Ping timeout: 276 seconds]
phaul has quit [Ping timeout: 276 seconds]
phaul has joined #ruby
JohanP has joined #ruby
phaul has quit [Ping timeout: 265 seconds]
suukim has quit [Quit: Konversation terminated!]
sergioro has joined #ruby
skx86 has joined #ruby
phaul has joined #ruby
TzilTzal has quit [Quit: Leaving.]
phaul has quit [Ping timeout: 268 seconds]
ellcs has joined #ruby
phaul has joined #ruby
ctOS has quit [Quit: Connection closed for inactivity]
phaul has quit [Ping timeout: 245 seconds]
jenrzzz has joined #ruby
phaul has joined #ruby
evert is now known as evertvdb
jenrzzz has quit [Ping timeout: 252 seconds]
phaul has quit [Ping timeout: 276 seconds]
big-malloc has joined #ruby
big-malloc has quit [Client Quit]
big-malloc has joined #ruby
phaul has joined #ruby
jenrzzz has joined #ruby
big-malloc has quit [Client Quit]
Creatornator has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
BTRE has joined #ruby
phaul has quit [Ping timeout: 250 seconds]
jenrzzz has quit [Ping timeout: 268 seconds]
phaul has joined #ruby
JohanP has quit [Ping timeout: 265 seconds]
JohanP has joined #ruby
gix- has joined #ruby
gix has quit [Disconnected by services]
Fernando-Basso has joined #ruby
JohanP has quit [Ping timeout: 250 seconds]
JohanP has joined #ruby
houhoulis has quit [Remote host closed the connection]
reber has joined #ruby
ur5us has joined #ruby
abc88 has joined #ruby
<abc88> Hi, I wonder if in a single quote string, the only thing to escape are \ and ' or if they are some special unicode character that must be escaped too, i mean is there some unicode charcter which may break from a single quote string as the ' does ?
<nofxx> abc88, would say no... maybe someone knows better tho... but there's also <<<HEREDOC syntax, maybe it fits your use
<nofxx> good for multiline
JohanP has quit [Ping timeout: 252 seconds]
cthulchu has quit [Read error: Connection reset by peer]
cthulchu has joined #ruby
reber has quit [Remote host closed the connection]
Technodrome has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
rippa has quit [Quit: {#`%${%&`+'${`%&NO CARRIER]
Creatornator has joined #ruby
JohanP has joined #ruby
Technodrome has joined #ruby
ellcs has quit [Ping timeout: 240 seconds]
JohanP has quit [Ping timeout: 268 seconds]
zapata has quit [Ping timeout: 250 seconds]
zapata has joined #ruby
itarato has joined #ruby
chalkmonster has quit [Quit: WeeChat 2.6]
<abc88> nofxx: thanks
abc88 has quit [Quit: .]
itarato has quit [Ping timeout: 240 seconds]
Technodrome has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
thecoffemaker has quit [Ping timeout: 265 seconds]
bluvinyl2 has joined #ruby
bluvinyl has joined #ruby
thecoffemaker has joined #ruby
Technodrome has joined #ruby
xco has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Creatornator has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
itarato has joined #ruby
Creatornator has joined #ruby
<gearnode> abc88: you can use %() or """ """" syntax for multiline :)
skx86 has quit [Quit: Connection closed for inactivity]
claudiuinberlin has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
JohanP has joined #ruby
NODE has quit [Quit: changing servers]
NODE has joined #ruby
sagax has quit [Remote host closed the connection]
JohanP has quit [Ping timeout: 265 seconds]
hiroaki has quit [Ping timeout: 240 seconds]
envex has quit [Ping timeout: 268 seconds]
sergioro has quit [Read error: Connection reset by peer]
NODE has quit [Quit: changing servers]
envex has joined #ruby
envex has quit [Excess Flood]
envex has joined #ruby
envex has quit [Excess Flood]
NODE has joined #ruby
envex has joined #ruby
envex has quit [Excess Flood]
envex has joined #ruby
envex has quit [Excess Flood]
envex has joined #ruby
NODE has quit [Client Quit]
NODE has joined #ruby
NODE has quit [Client Quit]
NODE has joined #ruby
Fernando-Basso has quit [Quit: Leaving]
redlegion has joined #ruby
davispuh has quit [Quit: http://quassel-irc.org - Chat comfortably. Anywhere.]
bvdw has quit [Read error: Connection reset by peer]
bvdw has joined #ruby
JohanP has joined #ruby
candlebag has quit [Remote host closed the connection]
candlebag has joined #ruby
JohanP has quit [Ping timeout: 276 seconds]
candlebag has quit [Remote host closed the connection]
candlebag has joined #ruby
candlebag_ has joined #ruby
candlebag has quit [Ping timeout: 240 seconds]
candlebag_ has quit [Remote host closed the connection]
candlebag_ has joined #ruby
candlebag__ has joined #ruby
ur5us has quit [Ping timeout: 250 seconds]
candlebag_ has quit [Ping timeout: 252 seconds]
candlebag_ has joined #ruby
SuperLag has quit [Quit: reboot]
SuperLag has joined #ruby
candlebag__ has quit [Ping timeout: 265 seconds]
candlebag_ has quit [Remote host closed the connection]
candlebag_ has joined #ruby
ur5us has joined #ruby
tpanarch1st has joined #ruby
JohanP has joined #ruby
candlebag__ has joined #ruby
candlebag_ has quit [Ping timeout: 240 seconds]
candlebag has joined #ruby
JohanP has quit [Ping timeout: 240 seconds]
znz_jp has quit [Ping timeout: 245 seconds]
skx86 has joined #ruby
candlebag__ has quit [Ping timeout: 276 seconds]