-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add catmandu selector select()
#271
Comments
Can you provide a use case? |
In context of OERSI I wanted to use it for filtering records, since we had multiple positive contitions:
I ended up using:
|
So you also need "reject unless selected" behaviour? That's not what I'm not even sure, though, if select() exists("name")
select() exists("license")
select() exists("creator[]") Wouldn't a subsequent You could, however, combine your if exists("name")
elsif exists("license")
elsif exists("creator[]")
else
reject()
end |
Scratch that. This can always be achieved with an unconditional |
Is
I would assume they would narrow this down? But it would be something like:
Thanks. I think what perhaps confuses you is that while I have a combined condition the rejection condition can be separated: Your workaround could not handle this. Since it would only check if the if exists("name")
if exists("license")
if exists("creator[]")
else
reject()
end
else
reject()
end
else
reject()
end But anyway it is not urgent. |
How? If any of your conditions doesn't hold, the if <condition>
select()
else
reject()
end
That would be odd, IMO. But we'd have to check with Catmandu to know for sure.
If we had boolean operators (#165), you wouldn't be asking for unless exists("name") && exists("license") && exists("creator[]")
reject()
end
Indeed! Sorry about that! So there's currently no way of simplifying your use case and it's dubious whether |
Catmandu has a selector
select()
: ttps://metacpan.org/pod/Catmandu::Fix::rejectThe text was updated successfully, but these errors were encountered: