@r3trofitted @noelrap

> I think you should be defining all these value constants as methods

That’s interesting. I can see that for a lot of constants, but not for ones that depend on identity like `Object.new`

I had a good conversation recently about how a Class is modified by being assigned to a constant - that’s a spooky behavior.

1
Share
Share on Mastodon
Share on Twitter
Share on Facebook
Share on Linkedin
Bradley Schaefer

@r3trofitted @noelrap I ended up with this (monstrosity? heh, idk) for an "identity" constant, what do you think? :D

Delete = Class.new { alias_method :inspect, def to_s = "MyGem::Delete" }.new

1
1y
Replies