<FromGitter>
<fusillicode_twitter> It seems that this is not allowed π€
<FromGitter>
<fusillicode_twitter> Spoiler: as already known I'm a noob with Crystal & even more with generics π
<FromGitter>
<fusillicode_twitter> (My mind is still shaped by my experience with dynamic programming languages)
<FromGitter>
<vladfaust> @fusillicode_twitter it's not about generics but about `record` macro which does not support blocks afaik
<FromGitter>
<fusillicode_twitter> @vladfaust I think that they support them :)
<FromGitter>
<fusillicode_twitter> let me get a piece of code
<FromGitter>
<vladfaust> I found it
<FromGitter>
<vladfaust> Yes, it has {{yield}}
<FromGitter>
<fusillicode_twitter> Yep
<FromGitter>
<vladfaust> TIL
<FromGitter>
<fusillicode_twitter> I was just writing a carc
<FromGitter>
<fusillicode_twitter> but you've been faster XD
<FromGitter>
<vladfaust> So, you might want to do `record ArrayPresentObject(T)`
<FromGitter>
<fusillicode_twitter> Oh yeah! That's it! It's working ;)
<FromGitter>
<vladfaust> Because generic variables must be within generic types π€
<FromGitter>
<fusillicode_twitter> Thanks as always πββοΈ β P.S: you may have guessed that I'm trying to add a `present` validations and open a PR ;)
<FromGitter>
<vladfaust> Btw, I have a dout of naming that kind of rule `presence`... Shouldn't it be smth like `nil: false`? :thinking:
<FromGitter>
<vladfaust> Yep, that' right. But no scopes
<FromGitter>
<fusillicode_twitter> > Yep, that' right. But no scopes β β Got it
<FromGitter>
<fusillicode_twitter> Regarding the naming it all depends on the rule internals IMHO
<FromGitter>
<vladfaust> I wonder what is your PR involving Arrays π
<FromGitter>
<vladfaust> Btw, if you have doubts about commit style, just take a look at any of my shards' commits
<FromGitter>
<fusillicode_twitter> > Btw, if you have doubts about commit style, just take a look at any of my shards' commits β β That's the first thing that I've done ;)
<FromGitter>
<vladfaust> I don't get it. You want to patch `Object`?
<FromGitter>
<fusillicode_twitter> Nope nope
<FromGitter>
<fusillicode_twitter> I had in mind to simply build a validation that would tell if you have a nil, an empty string, an empty array or an empty hash
<FromGitter>
<vladfaust> I don't like it!
<FromGitter>
<vladfaust> Shouldn't it be better to split into two rules: `nil` and `empty`?
<FromGitter>
<fusillicode_twitter> I can guess the reason but can you articulate it :)
<FromGitter>
<fusillicode_twitter> Oh well
<FromGitter>
<fusillicode_twitter> I like it :)
<FromGitter>
<vladfaust> It's more explicit
<FromGitter>
<vladfaust> *achually*
<FromGitter>
<fusillicode_twitter> π
<FromGitter>
<fusillicode_twitter> I'll try to submit 2 PRs
<FromGitter>
<vladfaust> If you dare! π
<FromGitter>
<fusillicode_twitter> well 2 PRs, 1 for the `nil` and 1 for the `empty`, not 1 for the `presence` XD
<FromGitter>
<vladfaust> Yes, yes, do it!
<FromGitter>
<vladfaust> Add specs!
<FromGitter>
<fusillicode_twitter> Don't worry, I'm a Rubyist. I'll begin working from the specs! ;D
<FromGitter>
<drum445> can't use module vars within a class :(
<FromGitter>
<fusillicode_twitter> mmm
<FromGitter>
<fusillicode_twitter> Maybe the `puts @@name` searches the `@@name` of the encapsulating class and not the one of the encapsulating module π€
<FromGitter>
<Blacksmoke16> @proyb6 oops! Good catch, thanks!
<FromGitter>
<j8r> yes it's what @fusillicode_twitter said @drum445
<FromGitter>
<kingsleyh> @straight-shoota and @dscottboggs_gitlab - I had a look through the rethinkdb code this weekend - and have created my own version that updates the original repo to work with 0.26.1 and takes the authentication stuff from the newer rethinkdb-lite repo and merges them together - since the older repo had way better coverage of the api - so at least it's working now - I did more of a patch up job to get it
<FromGitter>
... working than a proper overhaul - but I'd say it's functioning about the same as it used to now
<FromGitter>
<j8r> but don't know the code, can't say it's the best in your case
<FromGitter>
<drum445> yep that works best I think, I have a BaseRepo class which will contain that include line. Then all the repos that inherit off it will also have access to @@name
<FromGitter>
<drum445> Thanks again!
<FromGitter>
<drum445> although including the entire module (as it contains kemal routes) seems overkill, so for this use case I think I'll pass it through the the baserepo initializer