These are chat archives for dry-rb/chat

31st
Jul 2016
Piotr Solnica
@solnic
Jul 31 2016 11:58
@jdickey Dry::Types[‘strict.range’][“not range”] will raise TypeError
Chase Gilliam
@Ch4s3
Jul 31 2016 13:32
@solnic I just noticed this dead link on the ROM page http://rom-rb.org/advanced/flat-style-setup
Piotr Solnica
@solnic
Jul 31 2016 13:34
ah it should be /learn/advanced/flat-style-setup
@Ch4s3 ^
Chase Gilliam
@Ch4s3
Jul 31 2016 13:39
cool, thanks. here's a PR with a fix on the block page rom-rb/rom-rb.org#154
@solnic ^
Piotr Solnica
@solnic
Jul 31 2016 14:55
@Ch4s3 thanks :)
Jeff Dickey
@jdickey
Jul 31 2016 14:57

@solnic I know it will. My question was, is there any point to declaring a Dry::Types['strict.range'] in addition to the Dry::Types['range']? Is there anything that is necessarily done for Strict over and above what constitutes a valid value for non-Strict? In the case of Range, you can't really initialise a (standard Ruby) Range instance with anything other than a valid Range; hence, anything built on top of that should have the same limitation. Seems that Strict in this instance is merely a conventional placeholder, yes?

Not that that's a problem; I was just trying to explain to the other user of this code why the distinction exists, and I couldn't :P

Piotr Solnica
@solnic
Jul 31 2016 14:58
@jdickey plain definitions work as annotations and as a base for other types
ie in rom we use plain definitions in schemas
Jeff Dickey
@jdickey
Jul 31 2016 14:59
Right; that makes good sense. I think I can go wave my hands to the other guy appropriately now :D
Piotr Solnica
@solnic
Jul 31 2016 14:59
from which you, ie, can build a hash type that will reduce a hash to only include specified keys
Jeff Dickey
@jdickey
Jul 31 2016 15:03
I think I see that; I'm going to have to come up to speed on ROM again in my mythical spare time