howdoi has quit [Quit: Connection closed for inactivity]
alfiemax has joined #ruby
lightstalker has quit [Remote host closed the connection]
alfiemax has quit [Ping timeout: 260 seconds]
<ewanchic>
I didn't think I could do this, but...I can have duplicate keys in a hash on the same level? how do I reference each one? I'm not sure if this is the right this to do anyway.
<ewanchic>
ewanchic: nevermind
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
ianbrown78 has quit [Ping timeout: 255 seconds]
kujira has joined #ruby
ianbrown78 has joined #ruby
cnsvc_ has quit [Remote host closed the connection]
cnsvc_ has joined #ruby
tau has quit [Read error: Connection reset by peer]
braincrash has quit [Quit: bye bye]
brool has quit [Ping timeout: 272 seconds]
braincrash has joined #ruby
lightstalker has joined #ruby
Tempesta has joined #ruby
jenrzzz has joined #ruby
SeepingN has quit [Quit: The system is going down for reboot NOW!]
jenrzzz has quit [Ping timeout: 256 seconds]
smoochsmooch has quit [Quit: Connection closed for inactivity]
alfiemax has joined #ruby
znz_jp has joined #ruby
i9zO5AP has joined #ruby
Ai9zO5AP has quit [Ping timeout: 255 seconds]
cnsvc_ has quit [Ping timeout: 240 seconds]
ttoocs has joined #ruby
cnsvc_ has joined #ruby
cliluw has quit [Read error: Connection reset by peer]
cliluw has joined #ruby
jenrzzz has joined #ruby
chalkmonster has joined #ruby
jenrzzz has quit [Ping timeout: 260 seconds]
_whitelogger has joined #ruby
titanbiscuit has quit [Ping timeout: 246 seconds]
* lovelove
reading Perl docs and realizing how beautiful Python is
* lovelove
reading Python docs and realizing how beautiful Ruby is
lol768 has quit [Ping timeout: 248 seconds]
cliluw has quit [Read error: Connection reset by peer]
cliluw has joined #ruby
titanbiscuit has joined #ruby
<lovelove>
i gotta repost that in #python and #perl
lol768 has joined #ruby
cliluw has quit [Read error: Connection reset by peer]
cliluw has joined #ruby
cliluw has quit [Read error: Connection reset by peer]
cliluw has joined #ruby
ur5us has quit [Ping timeout: 240 seconds]
jenrzzz has joined #ruby
howdoi has joined #ruby
FastJack has joined #ruby
jenrzzz has quit [Ping timeout: 258 seconds]
NODE has quit [Quit: changing servers]
NODE has joined #ruby
bvdw has quit [Read error: Connection reset by peer]
bvdw has joined #ruby
FastJack has quit [Ping timeout: 256 seconds]
chalkmonster has quit [Quit: WeeChat 2.7.1]
ianbrown78 has quit [Ping timeout: 256 seconds]
chalkmonster has joined #ruby
chalkmonster has quit [Client Quit]
FastJack has joined #ruby
galaxie has quit [Ping timeout: 240 seconds]
al2o3-cr has quit [Quit: WeeChat 2.7.1]
jmcgnh has quit [Read error: Connection reset by peer]
ur5us has joined #ruby
jmcgnh has joined #ruby
TzilTzal has joined #ruby
al2o3-cr has joined #ruby
d3bug has quit [Quit: Connection closed for inactivity]
fercell has joined #ruby
gdonald has quit [Ping timeout: 240 seconds]
<howdoi>
I have ditched my JS gig for an ROR gig, did a do the right thing?
xorl has quit [Quit: xorlllllllllll]
markopasha has joined #ruby
galaxie has joined #ruby
ewanchic has quit [Ping timeout: 255 seconds]
ewanchic has joined #ruby
TzilTzal has quit [Quit: Leaving.]
TzilTzal has joined #ruby
ewanchic has quit [Ping timeout: 268 seconds]
caterfxo has quit [Quit: leaving]
caterfxo has joined #ruby
infinityfye has joined #ruby
hiroaki_ has quit [Ping timeout: 258 seconds]
duderonomy has quit [Ping timeout: 256 seconds]
Nilium has left #ruby [#ruby]
ewanchic has joined #ruby
sauvin has joined #ruby
TheAthlete has joined #ruby
LinuxKnight has joined #ruby
jenrzzz has joined #ruby
sdu has joined #ruby
jenrzzz has quit [Ping timeout: 256 seconds]
Inoklocae has joined #ruby
<Inoklocae>
[Global Notice] Hello, freenode will be undergoing maintenance 3 hours from now. Please disconnect from this network, connect to irc.quakenet.org, and join #Quakenet for updates, otherwise, you may be k-lined permanently from freenode. Thank you. -freenode staff
<Inoklocae>
[Global Notice] Hello, freenode will be undergoing maintenance 3 hours from now. Please disconnect from this network, connect to irc.quakenet.org, and join #Quakenet for updates, otherwise, you may be k-lined permanently from freenode. Thank you. -freenode staff
<Inoklocae>
[Global Notice] Hello, freenode will be undergoing maintenance 3 hours from now. Please disconnect from this network, connect to irc.quakenet.org, and join #Quakenet for updates, otherwise, you may be k-lined permanently from freenode. Thank you. -freenode staff
Inoklocae has left #ruby [#ruby]
ajacla has joined #ruby
<ajacla>
[Global Notice] Hello, freenode will be undergoing maintenance 3 hours from now. Please disconnect from this network, connect to irc.quakenet.org, and join #Quakenet for updates, otherwise, you may be k-lined permanently from freenode. Thank you. -freenode staff
<ajacla>
[Global Notice] Hello, freenode will be undergoing maintenance 3 hours from now. Please disconnect from this network, connect to irc.quakenet.org, and join #Quakenet for updates, otherwise, you may be k-lined permanently from freenode. Thank you. -freenode staff
<ajacla>
[Global Notice] Hello, freenode will be undergoing maintenance 3 hours from now. Please disconnect from this network, connect to irc.quakenet.org, and join #Quakenet for updates, otherwise, you may be k-lined permanently from freenode. Thank you. -freenode staff
ajacla has left #ruby [#ruby]
Smoacheodr has joined #ruby
<Smoacheodr>
[Global Notice] Hello, freenode will be undergoing maintenance 3 hours from now. Please disconnect from this network, connect to irc.quakenet.org, and join #Quakenet for updates, otherwise, you may be k-lined permanently from freenode. Thank you. -freenode staff
<Smoacheodr>
[Global Notice] Hello, freenode will be undergoing maintenance 3 hours from now. Please disconnect from this network, connect to irc.quakenet.org, and join #Quakenet for updates, otherwise, you may be k-lined permanently from freenode. Thank you. -freenode staff
<Smoacheodr>
[Global Notice] Hello, freenode will be undergoing maintenance 3 hours from now. Please disconnect from this network, connect to irc.quakenet.org, and join #Quakenet for updates, otherwise, you may be k-lined permanently from freenode. Thank you. -freenode staff
Smoacheodr has left #ruby [#ruby]
Eshaateop has joined #ruby
<Eshaateop>
[Global Notice] Hello, freenode will be undergoing maintenance 3 hours from now. Please disconnect from this network, connect to irc.quakenet.org, and join #Quakenet for updates, otherwise, you may be k-lined permanently from freenode. Thank you. -freenode staff
<Eshaateop>
[Global Notice] Hello, freenode will be undergoing maintenance 3 hours from now. Please disconnect from this network, connect to irc.quakenet.org, and join #Quakenet for updates, otherwise, you may be k-lined permanently from freenode. Thank you. -freenode staff
<Eshaateop>
[Global Notice] Hello, freenode will be undergoing maintenance 3 hours from now. Please disconnect from this network, connect to irc.quakenet.org, and join #Quakenet for updates, otherwise, you may be k-lined permanently from freenode. Thank you. -freenode staff
Eshaateop has left #ruby [#ruby]
Cork has quit [Remote host closed the connection]
<baweaver>
Is it time to set registered only again? So soon?
Edrash has joined #ruby
<Edrash>
[Global Notice] Hello, freenode will be undergoing maintenance 3 hours from now. Please disconnect from this network, connect to irc.quakenet.org, and join #Quakenet for updates, otherwise, you may be k-lined permanently from freenode. Thank you. -freenode staff
<Edrash>
[Global Notice] Hello, freenode will be undergoing maintenance 3 hours from now. Please disconnect from this network, connect to irc.quakenet.org, and join #Quakenet for updates, otherwise, you may be k-lined permanently from freenode. Thank you. -freenode staff
<Edrash>
[Global Notice] Hello, freenode will be undergoing maintenance 3 hours from now. Please disconnect from this network, connect to irc.quakenet.org, and join #Quakenet for updates, otherwise, you may be k-lined permanently from freenode. Thank you. -freenode staff
Edrash has left #ruby [#ruby]
DaRock has quit [Read error: Connection reset by peer]
cnsvc_ has quit [Ping timeout: 240 seconds]
<baweaver>
You'll have to auth to the NickServ to chat, see the channel topic for more info
<TomyWork>
oh this just unpacks pi from a binary-ish string
impermanence has joined #ruby
duderonomy has joined #ruby
sam808080 has quit [Ping timeout: 258 seconds]
mre- has quit [Ping timeout: 258 seconds]
mre- has joined #ruby
SeepingN has joined #ruby
romanlevin has quit [Quit: Ping timeout (120 seconds)]
romanlevin has joined #ruby
burningserenity has joined #ruby
mre- has quit [Ping timeout: 258 seconds]
ellcs has quit [Ping timeout: 240 seconds]
mre- has joined #ruby
tomaw_ is now known as tomaw
legalproblem has joined #ruby
sdu has quit [Remote host closed the connection]
cnsvc_ has joined #ruby
kinduff has quit [Read error: Connection reset by peer]
kinduff has joined #ruby
brool has joined #ruby
cnsvc_ has quit [Ping timeout: 240 seconds]
drincruz has quit [Ping timeout: 255 seconds]
DTZUZU has quit [Ping timeout: 240 seconds]
cnsvc_ has joined #ruby
DTZUZU has joined #ruby
cnsvc_ has quit [Ping timeout: 240 seconds]
MrCrackPot has joined #ruby
conta1 has joined #ruby
mre- has quit [Ping timeout: 268 seconds]
<CommunistWolf>
lovelove needs banning
mre- has joined #ruby
conta1 has quit [Ping timeout: 260 seconds]
prestori_ has joined #ruby
RefactoredNoise has joined #ruby
whathappens has quit [Read error: Connection reset by peer]
<havenwood>
!rude lovelove
prestorium has quit [Ping timeout: 258 seconds]
prestori_ has quit [Ping timeout: 256 seconds]
d3bug has joined #ruby
dviola has quit [Quit: WeeChat 2.7.1]
mre- has quit [Ping timeout: 255 seconds]
burningserenity has quit [Remote host closed the connection]
RefactoredNoise has quit [Quit: WeeChat 2.7.1]
RefactoredNoise has joined #ruby
legalproblem has quit [Ping timeout: 268 seconds]
mre- has joined #ruby
RefactoredNoise has quit [Client Quit]
cnsvc_ has joined #ruby
paddor_ has joined #ruby
<paddor_>
Hi guys
<paddor_>
I'm going crazy and need your help. I'm trying to use super in a class method ankered in my Base class. Ruby tells me there is no superclass method for the sub class. If I remove super and explicitly type `superclass.foo`, it works. Why?
cnsvc_ has quit [Ping timeout: 240 seconds]
fercell has quit [Quit: WeeChat 2.7]
<leftylink>
unfortunately, I couldn't reproduce the problem from just the written description of it; the code I came up with that best represents the written description was
<leftylink>
&>> class A; def self.f; :yes end; end; class B < A; def self.g; f end; end; B.g
<paddor_>
Base and all its subclasses act as singletons in this case, because the state is in class-level instance variables.
cnsvc_ has quit [Ping timeout: 240 seconds]
<havenwood>
paddor_: Well, you *can* just put instance variables on anything - but a Singleton mixin is a different thing.
<havenwood>
paddor_: See the docs above ^
<paddor_>
Btw, I forgot to call #dup on the super's result. That doesn't solve this weird error though. If anyone wants to have a try at it: https://carc.in/#/r/8o3d
<paddor_>
havenwood: Dude, I know what the singleton pattern is. It's about making sure only one instance of a certain class is created and accessed. That is not what I need here. Thanks for your help though.
<havenwood>
paddor_: I just wondered, since this *isn't* a Ruby singleton - you're just using an instance method at the class level, which is an antipattern generally.
<havenwood>
paddor_: You should probably use a mixin here, rather than inheritance
<havenwood>
paddor_: It's hard to tell *why* you're doing this from the code your'e showing
<paddor_>
Okay, then how would you implement the factory pattern or where do you think ActiveRecord's has_many is implemented?
DTZUZU has quit [Ping timeout: 255 seconds]
ewanchic has quit [Ping timeout: 240 seconds]
royal_screwup21 has joined #ruby
ellcs has joined #ruby
DTZUZU has joined #ruby
<paddor_>
Without going into too much detail: I want to be able to declare certain attributes as special, and I wanna do this on class-level (like has_many and friends) and I want the it to inherit the list of special attribute names from the superclass the first time this is done in a sub class. I need this to remove these properties in #initialize_dup.
<havenwood>
paddor_: The Rails attributes API is actually quite nice if you want to make a custom ActiveModel that's ActiveRecord-like. Is this for a Rails app or outside Rails?
burningserenity has joined #ruby
<paddor_>
I'm not using Rails or ActiveModel or ActiveRecord.
<havenwood>
paddor_: Ah, okay. I was gunna say I gave a talk on the attributes API with ActiveModel, which is actually pretty neat. https://youtu.be/6h5TbKBnLws
<havenwood>
paddor_: You can use it outside of Rails too.
<havenwood>
paddor_: You simple cherry pick just attributes in a class with `include ActiveModel::Attributes`.
<paddor_>
That's really cool. But I'm more interested in why `super` doesn't work in that case.
ewanchic has joined #ruby
<havenwood>
paddor_: The reason is that `super` looks down the ancestry chain for a method defined by the same name.
royal_screwup21 has quit [Remote host closed the connection]
whathappens has joined #ruby
<havenwood>
paddor_: As soon as I get out of meetings I can show how to do a similar pattern.
<havenwood>
(Unless someone beats me to it.)
<paddor_>
Exactly. So what's the issue with https://carc.in/#/r/8o3m (updated to show my needs btw)?
royal_screwup21 has joined #ruby
markopasha has joined #ruby
ewanchic has quit [Ping timeout: 255 seconds]
ianbrown78 has joined #ruby
cnsvc_ has joined #ruby
whathappens has quit [Remote host closed the connection]
LinuxKnight has quit [Ping timeout: 240 seconds]
bvdw has quit [Read error: Connection reset by peer]
bvdw has joined #ruby
ianbrown78 has quit [Ping timeout: 255 seconds]
cisco has quit [Ping timeout: 258 seconds]
cnsvc_ has quit [Ping timeout: 240 seconds]
royal_screwup21 has quit [Remote host closed the connection]
cthulchu_ has joined #ruby
SeepingN_ has joined #ruby
SeepingN has quit [Disconnected by services]
sameerynho has quit [Ping timeout: 260 seconds]
iNs has quit [Ping timeout: 240 seconds]
<adam12>
havenwood: The callback pattern around the 7 minute mark is handy. I was just doing it manually in a project (some_before_hook.call, do work, some_after_hook.call) and thinking I need to put an abstraction around it.
iNs has joined #ruby
burningserenity has quit [Read error: Connection reset by peer]
burningserenity has joined #ruby
robotcars has joined #ruby
<robotcars>
seem to have lost limit() with activesupport between 5.2.2 and 6.0.2.1
<howdoi>
I have ditched my JS gig for an ROR gig, did a do the right thing?
<havenwood>
adam12: Yeah, I was pleased to find that. :)
<havenwood>
howdoi: Sounds good to me.
TzilTzal has quit [Quit: Leaving.]
burningserenity has joined #ruby
<howdoi>
havenwood: many are like, why ROR? [It is dying]
<howdoi>
+ Go or something would pay you more
<havenwood>
howdoi: None of the most used frameworks in the world are dying. ¯\_(ツ)_/¯
<havenwood>
howdoi: Who pays Go programmers more? Haha.
<havenwood>
howdoi: I thought the idea of Go was the opposite, making it easy for students to get coding quickly.
<howdoi>
havenwood: lolz, Okies, that's comforting, but if you chose to be a engineering manager one day, the tech shouldn't matter
<apotheon>
Initially, Go was pretty clearly getting pushed as a replacement for C, then for C++.
<havenwood>
howdoi: I think learning to code well in any language is the most important thing for pay. I've noticed way more differentiation in pay based on what you can do, rather than the language you do it in.
<apotheon>
It's actually a Java replacement, and they missed the boat by not pushing it as such.
ewanchic has joined #ruby
infinityfye has quit [Ping timeout: 255 seconds]
<apotheon>
I guess they couldn't, though, because that'd undermine all the work on Android.
<paddor_>
havenwood: The properties in your examples are not inherited. Also, I'd like to avoid meta programming.
<havenwood>
apotheon: Also, Android has a 10-billion-dollar verdict and potential for related injunctions hanging over its head. We'll see how that goes! If Oracle's gets a painful injunction we may see a lot more Fuschia.
<havenwood>
Fuchsia*
<paddor_>
havenwood: And my entities are not singletons.
<apotheon>
Oracle needs to die in a fire.
hutch has quit [Ping timeout: 268 seconds]
<apotheon>
The very idea of suing over API compliance is evil.
<havenwood>
paddor_: I can't see where inheritance matters in your example. I think the example of what you're doing is too contrived for me to implement something you'd like. Do you have something a bit more zoomed out that shows how you'd like to use this?
<paddor_>
https://carc.in/#/r/8o3m Anybody? A simple answer as to why it doesn't work would suffice.
<paddor_>
havenwood: It doesn't get any simpler and clearer than that.
Esa_ has quit []
<havenwood>
paddor_: Your code isn't straightforward at all. It's bizarre. You're inheriting a method and seem to think #super has something to fall back to, but it doesn't. You're not calling a #properties method on A or B that has a #super to Base.
<paddor_>
havenwood: Okay. Then what is Base.property to A.property given A < Base? Not the super method?
ellcs has quit [Ping timeout: 255 seconds]
postmodern has joined #ruby
<havenwood>
paddor_: If you defined an A#properties method on A, then #super would be Base#properties.
<havenwood>
paddor_: You can't super from a method defined on Base to the same method defined on Base. I'm not following why you think this will work.
<paddor_>
It's defined in Base. class A; def self.foo() :foo end end; class B < A; end; B.foo # <- this works, after all
hutch has joined #ruby
<havenwood>
paddor_: Maybe show how you expect to use this in practice, so we can show an appropriate pattern? How are you planning to use the inheritance aspect?
<paddor_>
I'm not trying to call super from Base. That's why there is if self == Base.
<paddor_>
havenwood: It's shown in the two classes A and B and the last two lines. A.properties should return [:foo] and B.properties should return [:foo, :bar].
jmcgnh has quit [Read error: Connection reset by peer]
<adam12>
paddor_: You're in the singleton or eigenclass when you attempt to call super. I don't believe that the singleton class is inherited the same way as normal classes are. Is there anything wrong with just calling superclass how you are?
<paddor_>
Look, no matter what my usecase is. Why does `super` NOT work, while `superclass.properties` works? It's a simple question about Ruby.
jmcgnh has joined #ruby
<adam12>
paddor_: Your attitude isn't welcome here. We're all volunteers trying to help.
<paddor_>
I guess there is nothing wrong with `superclass.properties`. But I'm wondering why `super` doesn't work, since methods in the singleton class are obviously inherited as well: https://carc.in/#/r/8o4n
<adam12>
paddor_: You're inheriting a class. The singleton class is a class inside the class. Maybe you can hook into the `included` method to do some magic. It's obviously not a simple question or else you would of had an answer.
<leftylink>
by the way, it did not matter whether they are class methods or not.
<leftylink>
&>> class A; def foo; if self.class == A; :yes else; super end; end; end; class B < A; end; [A.new.foo, (B.new.foo rescue :no)]
<leftylink>
so, suppose the answer is "super cares not who calls it, but who defined it" ?
burningserenity has quit [Read error: Connection reset by peer]
burningserenity has joined #ruby
<leftylink>
compare probably clearer to say
<leftylink>
&>> class A; def foo; if self.class == A; :yes else; super end; end; end; class B < A; end; [A.new.foo, (begin; B.new.foo; rescue => e; e.message end)]
<rubydoc>
# => [:yes, "super: no superclass method `foo' for #<B:0x00005635687d5fe8>\nDid you mean? for"] (https://carc.in/#/r/8o4r)
<leftylink>
as you can see.
<leftylink>
s/compare//
<leftylink>
it's not a comparison, it's a clarification of the same
<paddor_>
leftylink: Interesting. Thanks. I never knew this quirk about super.
<leftylink>
I opine that a contributing factor was that the error message didn't designate the owner of foo
<paddor_>
And sorry for my attitude.
TomyWork has quit [Ping timeout: 256 seconds]
snuz has quit [Read error: Connection reset by peer]
paddor_ has left #ruby [#ruby]
paddor_ has joined #ruby
<paddor_>
leftylink: Good input. Now I get it. `super` only works one level up.
<paddor_>
leftylink: Scratch that. I was accidentally using superclass.foo instead of super. It still doesn't really make sense.
<paddor_>
Thanks for your help. Gotta go buy food. Stay safe
Fernando-Basso has quit [Quit: Leaving]
paddor_ has quit [Quit: paddor_]
<leftylink>
hmm. it's about asking "what model of the world leads to this belief" and "can we challenge that model with examples". but the example must not be good enough. I will see if there is a way to make a better one.
sauvin has quit [Read error: Connection reset by peer]
litt has joined #ruby
caterfxo has quit [Quit: leaving]
<leftylink>
it is difficult. next time, maybe I would show who the owner of foo is
<leftylink>
&>> class A; def foo end; end; class B < A; end; B.new.method(:foo).owner
<rubydoc>
stderr: -e:4: syntax error, unexpected `end', expecting ';' or '\n'... check link for more (https://carc.in/#/r/8o55)
<leftylink>
oh no
<leftylink>
&>> class A; def foo; end; end; class B < A; end; B.new.method(:foo).owner
<kaleido>
yeah that's all. i start to try to do something and inevitably i have to google for basic things with String :)
<kaleido>
i just need to make more time to get the reps in
<havenwood>
kaleido: You might like exploring options with Pry, until you're familiar with available methods.
<havenwood>
?pry kaleido
<ruby[bot]>
kaleido: Pry, the better IRB, provides easy object inspection `ls`, `history`, viewing docs `?`, viewing source `$`, syntax highlighting and other features (see `help` for more). Put `binding.pry` in your source code for easy debugging. Install Pry (https://pryrepl.org/): gem install pry pry-doc
<leitz>
Of course, 'better' is an opinion. ;)
<kaleido>
havenwood: thanks, i'll do that
<_phaul>
?better
<ruby[bot]>
"Best" and "better" are subjective. Try to use a different term, or try to qualify what would make one thing better than the other.
<_phaul>
:)
alexherbo29 has joined #ruby
cliluw has quit [Read error: Connection reset by peer]
cliluw has joined #ruby
code_zombie has joined #ruby
caterfxo has joined #ruby
alexherbo2 has quit [Ping timeout: 255 seconds]
alexherbo29 is now known as alexherbo2
ur5us has joined #ruby
ellcs has joined #ruby
cnsvc_ has joined #ruby
ellcs has quit [Ping timeout: 240 seconds]
duderonomy has quit [Read error: Connection reset by peer]
chalkmonster has joined #ruby
chalkmonster has quit [Client Quit]
hiroaki_ has joined #ruby
cnsvc_ has quit [Ping timeout: 240 seconds]
regedit has joined #ruby
wildtrees has joined #ruby
rippa has quit [Quit: {#`%${%&`+'${`%&NO CARRIER]
duderonomy has joined #ruby
Emmanuel_Chanel has quit [Ping timeout: 258 seconds]
<apotheon>
paddor: My understanding of why things don't work the way you wrote them is that A doesn't have the properties method, so it executes the method in Base, but the results of checking the class is still that you're using A even though it's executing something in Base. Thus, the super method refers to Class (the superclass of Base), which doesn't have a properties method.
royal_screwup21 has joined #ruby
<apotheon>
paddor: The reason superclass works, but super doesn't, is that superclass searches the inheritance tree for the superclass of the currently identified class, not the superclass of the implementor of the currently executing method.
<apotheon>
paddor: Hopefully I'm not mistaken about what's going on, and hopefully that helps you.
<paddor>
apotheon: So `self` would still be A, even while executing the supermethod.
ellcs has quit [Ping timeout: 268 seconds]
<apotheon>
yep
<apotheon>
That approach should help performance and resource burden, because otherwise I think you'd basically have to either add a (relative) bunch more code to target a different class context with the inherited method or you'd have to basically copy all inherited methods to the new context.
<paddor>
apotheon: Ah no, self is what I expect it to be. But as you said, `super` seems to act more lexicographically than semantically.
ellcs has joined #ruby
<leftylink>
self is as expected
<leftylink>
&>> class A; def self.f; self end end; class B < A; end; [A.f, B.f]
Macrobiotic has quit [Quit: Connection closed for inactivity]
<apotheon>
irb(main):002:0> class Base; def self.s; p self.class.name; end; end; class A < Base; end; A.s
<apotheon>
"Class"
<paddor>
apotheon: Mostly. So `super` works as expected in instance methods because they're not defined in the singleton class? Like C < B < A, where A#foo is defined and C#foo calls super. I'm pretty sure that works.
<apotheon>
I've gotta go.
<apotheon>
g'luck
<leftylink>
based on my current understanding, I do not believe there is a difference between class methods and instance methods in their behaviour of super
<leftylink>
an example could change my understanding
burningserenity has quit [Quit: Leaving.]
<paddor>
leftylink: You're right.
mre- has quit [Ping timeout: 258 seconds]
alfiemax has joined #ruby
<paddor>
leftylink: I think my brain was on vacation earlier. Of course `self` is always the calling object. And it works with `superclass.meth` because it's a new call on a different object.
x0n has joined #ruby
jjarvis has joined #ruby
alfiemax has quit [Ping timeout: 260 seconds]
<_phaul>
I like to believe that ruby does not care nor does it know if it's executing an instance method or a class method. This was said in the Dave Thomas ruby object model lecture video. I'm not sure if it's still 100% true for all MRIs or there are some special optimization handlings under the hood. But I've never observed anything to the contrary
kristofferR has joined #ruby
markopasha has quit [Read error: Connection reset by peer]
kristofferR has quit [Client Quit]
markopasha has joined #ruby
markopasha has quit [Read error: Connection reset by peer]
mre- has joined #ruby
ellcs has quit [Ping timeout: 268 seconds]
mre- has quit [Ping timeout: 268 seconds]
jjarvis has quit [Quit: WeeChat 2.7.1]
cnsvc_ has quit [Ping timeout: 240 seconds]
royal_screwup21 has quit [Remote host closed the connection]
istrasci has joined #ruby
<istrasci>
I'm seeing documentation for a `String#/` method (alias for #split - https://ruby-doc.org/core-2.7.0/String.html#method-i-2F), but I can't get it to work. Keep getting a NoMethodError. Am I doing something wrong, or is this really not implemented? If not, why is it documented?
d3bug has quit [Quit: Connection closed for inactivity]
chalkmonster has joined #ruby
<_phaul>
&>> 'xxx' / 'x'
<rubydoc>
stderr: -e:4:in `<main>': undefined method `/' for "xxx":String (NoMethodError)... check link for more (https://carc.in/#/r/8o5n)
<_phaul>
&ri String#-
<rubydoc>
Found no entry that matches class String instance method -
<leftylink>
I like how the "show source" shows nothing
<leftylink>
as opposed to other methods (they show something)
<istrasci>
Then I'm not crazy...
<_phaul>
I searched but could not find _any_ trace of where this documentation is coming from, it's not there in any of the git tags that was released for 2.7. Going back in history I can't find a revision where it shows up..
<_phaul>
checked preview releases too..
<leftylink>
note there's a different icon for it
<leftylink>
the icon has a chain link or something
<leftylink>
it must be different from the things without the chain icon
<leftylink>
but in what way
<_phaul>
defined by alias?
<leftylink>
I see
cd has joined #ruby
troulouliou_div2 has quit [Quit: Leaving]
stemid has joined #ruby
<stemid>
when do rbenv install -l versions update? I've done a git pull in my rbenv repo. followed the install instructions. but if I do rbenv install -l I only get 2.6.4. I'm after 2.6.5
<stemid>
I noticed github issues saying 2.6.5 is available for mac os users.
<havenwood>
stemid: Update ruby-build rather than rbenv.
<stemid>
oh wait, I didn't even read my own instructions. my old docs said precisely that. go into ruby-build; git pull; rbenv install -l
<stemid>
yup there it is. now 2.6.5 shows up. thanks. had forgotten ruby-build was a plugin to rbenv
troulouliou_div2 has joined #ruby
dStromboli has quit [Ping timeout: 256 seconds]
hutch has quit [Ping timeout: 258 seconds]
hutch has joined #ruby
hiroaki_ has quit [Ping timeout: 256 seconds]
alexherbo2 has quit [Ping timeout: 265 seconds]
reyfi9e has quit [Remote host closed the connection]
chalkmonster has quit [Quit: WeeChat 2.7.1]
unreal has quit [Ping timeout: 240 seconds]
gordie has joined #ruby
<gordie>
Hi !
Frobozz___ has quit [Quit: quit]
unreal has joined #ruby
<gordie>
I'm quite new to Ruby. I'm trying to deploy my app on Heroku. Well, I did, but I've got some troubles with it. Some endpoints of my API are protected with an API key that checks for the user in the database. My app fails at it. I think that it fails reaching the database. Can anyone help with that ?
<gordie>
The non-protected endpoints do work.
reyfi9e has joined #ruby
sergioro has joined #ruby
Emmanuel_Chanel has joined #ruby
chalkmonster has joined #ruby
jmcgnh has quit [Read error: Connection reset by peer]
mre- has joined #ruby
jmcgnh has joined #ruby
regedit has quit [Quit: Connection closed for inactivity]
ur5us has quit [Ping timeout: 256 seconds]
mre- has quit [Ping timeout: 255 seconds]
<havenwood>
gordie: Show the relevant code?
ur5us has joined #ruby
<gordie>
Is it possible that my heroku DB is corrupted and that fetching a row fires a 500 error ?
<gordie>
I would like to show the relevant code but cannot find where the bug is...... works perfectly locally.
<havenwood>
gordie: Sanity check the DB settings maybe? Have you tried switching to a new Heroku DB? I dunno!
SeepingN_ has quit [Read error: Connection reset by peer]