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]