jhass[m] changed the topic of #ruby to: Rules: https://ruby-community.com | Ruby 3.1.2, 3.0.4, 2.7.6: https://www.ruby-lang.org | Paste 4+ lines to: https://gist.github.com | Books: https://goo.gl/wpGhoQ
gr33n7007h has quit [Ping timeout: 272 seconds]
gr33n7007h has joined #ruby
andrea[m]1234 has joined #ruby
Rounin has quit [Ping timeout: 240 seconds]
sylario has quit [Quit: Connection closed for inactivity]
ule_ is now known as ule
ule has quit [Changing host]
ule has joined #ruby
howdoi has quit [Quit: Connection closed for inactivity]
dviola has quit [Quit: WeeChat 3.5]
Ziyan has joined #ruby
John_Ivan has quit [Ping timeout: 272 seconds]
Ziyan has quit [Ping timeout: 240 seconds]
Ziyan has joined #ruby
mixfix41 has joined #ruby
darkstarx has quit [Read error: Connection reset by peer]
jmcgnh has quit [Ping timeout: 240 seconds]
jmcgnh has joined #ruby
gr33n7007h has quit [Quit: WeeChat 3.5]
gr33n7007h has joined #ruby
_ht has joined #ruby
ralu13 has joined #ruby
kenichi_ has joined #ruby
PedroG2 has joined #ruby
rapha has quit [Ping timeout: 246 seconds]
PedroG1 has quit [Ping timeout: 246 seconds]
tonytonyjan has quit [Ping timeout: 246 seconds]
perrierjouet has quit [Ping timeout: 246 seconds]
kenichi has quit [Ping timeout: 246 seconds]
eldritch has quit [Ping timeout: 246 seconds]
ralu1 has quit [Ping timeout: 246 seconds]
IsoLinCHiP has quit [Ping timeout: 246 seconds]
ralu13 is now known as ralu1
ur5us has quit [Ping timeout: 260 seconds]
tonytonyjan has joined #ruby
eldritch has joined #ruby
rapha has joined #ruby
perrierjouet has joined #ruby
IsoLinCHiP has joined #ruby
_ht has quit [Remote host closed the connection]
hd1 has joined #ruby
hd1 has left #ruby [#ruby]
teclator has joined #ruby
infernix has quit [Ping timeout: 240 seconds]
infernix has joined #ruby
titibandit has joined #ruby
Rounin has joined #ruby
TomyWork has joined #ruby
protektwar has joined #ruby
protektwar has joined #ruby
sagax has quit [Remote host closed the connection]
titibandit has quit [Remote host closed the connection]
Ziyan has quit [Ping timeout: 260 seconds]
Ziyan has joined #ruby
dionysus69 has joined #ruby
schne1der has joined #ruby
jpn has joined #ruby
szkl has joined #ruby
dionysus69 has quit [Ping timeout: 276 seconds]
dionysus69 has joined #ruby
schne1der has quit [Ping timeout: 240 seconds]
schne1der has joined #ruby
<dionysus69> any thoughts on this kind of syntax on hashes ?
<dionysus69> custom_hash = CustomHash.new
<dionysus69> custom_hash.some_key = value
<dionysus69> custom_hash.some_second_key.new_custom_hash_key = value
<dionysus69> custom_hash.some_non_existing_key; => nil
<dionysus69> the only potential problem I see is the key and method name collision, anything else?
Ziyan has quit [Read error: Connection reset by peer]
Ziyan has joined #ruby
gproto23 has joined #ruby
Ziyan has quit [Quit: Textual IRC Client: www.textualapp.com]
rapha has quit [Changing host]
rapha has joined #ruby
titibandit has joined #ruby
szkl has quit [Quit: Connection closed for inactivity]
protektwar has quit [Ping timeout: 272 seconds]
protektwar has joined #ruby
protektwar has joined #ruby
protektwar has quit [Changing host]
Tempesta has quit [Quit: See ya!]
protektwar has quit [Quit: quitting away..]
protektwar has joined #ruby
protektwar has quit [Changing host]
protektwar has joined #ruby
Tempesta has joined #ruby
jpn has quit [Ping timeout: 260 seconds]
titibandit has quit [Quit: Leaving.]
Dooky has joined #ruby
schne1der has quit [Ping timeout: 240 seconds]
jpn has joined #ruby
schne1der has joined #ruby
jpn has quit [Ping timeout: 244 seconds]
Ziyan has joined #ruby
<adam12> dionysus69: It looks similar to Hashie::Mash.
sylario has joined #ruby
jpn has joined #ruby
jpn has quit [Ping timeout: 240 seconds]
<dionysus69> adam12: I will check it out :)
<adam12> dionysus69: Some consider it a anti-pattern, fyi :)
<dionysus69> to be honest, hash syntax could be way better, it's not up to the ruby standard I think
<dionysus69> why?
<dionysus69> hash is an object right, why can't we have methods that retrieve keys?
finsternis has quit [Ping timeout: 248 seconds]
gproto23 has quit [Remote host closed the connection]
<leah2> because keys are not methods
<adam12> dionysus69: Almost anything in Ruby can be a Hash key.
<dionysus69> adam12: meaning all the method names?
<adam12> { Time.now => "the current time" }
<dionysus69> ah right
<dionysus69> I mean, you would have an option to use that syntax too
<adam12> Even Time.now is a bad example.
<dionysus69> the new class would of course inherit from Hash class
<adam12> Does your solution use method missing?
<dionysus69> no onewould be doing this has.Time.now expecting value out
<dionysus69> hash.Time.now
<dionysus69> adam12: I don't have a solution yet
<dionysus69> just theorizing stage
<dionysus69> can use next innovation week at my job on this :D
<adam12> This is generally a sign where I want proper object modelling. If PORO is too limiting, maybe a Dry::Struct with some sort of DTO to marshal the data in and out.
John_Ivan has joined #ruby
<adam12> I've used Hashie::Mash (which is similar to your pattern) in projects in the past, and I'm still pulling it out of some places. Other than for quick projects, I usually regret using it as it hides the shape of an object.
jpn has joined #ruby
<ox1eef> there's ryo, too - https://github.com/0x1eef/ryo.rb - despite being more than just an openstruct, i would bet it is less code than hashie and all those types of libs. API: Ryo::Object.from({one: {two: {three: 4}}}).one.two.three
jpn has quit [Ping timeout: 272 seconds]
Ziyan has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
<adam12> ox1eef: neat
<ox1eef> obrigado
jpn has joined #ruby
Ziyan has joined #ruby
schne1der has quit [Ping timeout: 272 seconds]
schne1der has joined #ruby
cocalero has joined #ruby
dionysus69 has quit [Ping timeout: 260 seconds]
bit4bit has joined #ruby
seabre has quit [Ping timeout: 240 seconds]
infinityfye has joined #ruby
seabre has joined #ruby
gproto23 has joined #ruby
gproto23_ has joined #ruby
gproto23 has quit [Quit: Leaving]
gproto23_ has quit [Remote host closed the connection]
TomyWork has quit [Remote host closed the connection]
kenichi_ is now known as kenichi
gproto23 has joined #ruby
___nick___ has joined #ruby
bit4bit has quit [Ping timeout: 244 seconds]
gproto23 has quit [Remote host closed the connection]
jpn has quit [Ping timeout: 260 seconds]
jpn has joined #ruby
jpn has quit [Quit: Lost terminal]
___nick___ has quit [Quit: https://quassel-irc.org - Chat comfortably. Anywhere.]
___nick___ has joined #ruby
Sankalp has quit [Ping timeout: 276 seconds]
___nick___ has quit [Client Quit]
___nick___ has joined #ruby
Sankalp has joined #ruby
dionysus69 has joined #ruby
___nick___ has quit [Quit: https://quassel-irc.org - Chat comfortably. Anywhere.]
___nick___ has joined #ruby
vertebrate3 has joined #ruby
vertebrate3 has quit [Ping timeout: 272 seconds]
_ht has joined #ruby
Hobbyboy has quit [Ping timeout: 248 seconds]
Hobbyboy has joined #ruby
Sheilong has joined #ruby
infinityfye has quit [Quit: Leaving]
schne1der has quit [Ping timeout: 276 seconds]
spuz has joined #ruby
schne1der has joined #ruby
bit4bit has joined #ruby
protektwar has quit [Ping timeout: 272 seconds]
spuz has quit [Quit: Client closed]
Ziyan has quit [Ping timeout: 260 seconds]
Ziyan has joined #ruby
protektwar has joined #ruby
protektwar has quit [Changing host]
protektwar has joined #ruby
spuz has joined #ruby
spuz has quit [Ping timeout: 252 seconds]
Ziyan has quit [Ping timeout: 272 seconds]
Ziyan has joined #ruby
_ht has quit [Remote host closed the connection]
___nick___ has quit [Ping timeout: 244 seconds]
Ziyan has quit [Quit: Textual IRC Client: www.textualapp.com]
protektwar has quit [Ping timeout: 260 seconds]
dionysus70 has joined #ruby
dionysus69 has quit [Read error: Connection reset by peer]
dionysus70 is now known as dionysus69
schne1der has quit [Ping timeout: 260 seconds]
ur5us has joined #ruby
dionysus69 has quit [Read error: Connection reset by peer]
dionysus70 has joined #ruby
schne1der has joined #ruby
dionysus70 is now known as dionysus69
schne1der has quit [Ping timeout: 240 seconds]
schne1der has joined #ruby
schne1der has quit [Remote host closed the connection]
schne1der has joined #ruby
havenwood has quit [Quit: The Lounge - https://thelounge.chat]
havenwood has joined #ruby
schne1der has quit [Ping timeout: 276 seconds]
schne1der has joined #ruby
emcb542 has joined #ruby
emcb54 has quit [Ping timeout: 240 seconds]
emcb542 is now known as emcb54
dionysus69 has quit [Quit: dionysus69]
dionysus69 has joined #ruby
bit4bit has quit [Remote host closed the connection]
TCZ5 has joined #ruby
Sheilong has quit [Quit: Connection closed for inactivity]
<havenwood> dionysus69: A Struct literal might work for what you're hoping for.
<havenwood> dionysus69: Ruby doesn't have a Struct literal yet, but Matz is considering adding one.
<havenwood> dionysus69: Here's my Ruby implementation of one. https://gist.github.com/havenwood/0287e216efdce2997f8dbc978b0426d8
schne1der has quit [Ping timeout: 248 seconds]
Mikaela has quit [Remote host closed the connection]
Mikaela has joined #ruby
TCZ5 has quit [Quit: ...]
dionysus69 has quit [Read error: Connection reset by peer]
dionysus70 has joined #ruby
dionysus70 is now known as dionysus69