Replies: 2 comments
-
If the matching element is a string, it is yielded. For other cases, it's probably not possible to know. You can use an iterative approach in that case: array.each do |element|
r.on element do
# ...
end
end |
Beta Was this translation helpful? Give feedback.
-
In the API I'm designing, it is possible to access resources in two ways:
So the matching element is string, but it is not possible to differentiate the index based on the value of the yielded value. Iterative approach you suggested makes sense. I'll go with that. Thanks. |
Beta Was this translation helpful? Give feedback.
-
Arrays match when any of their elements match. Is there a way to find which element matched to the path?
Beta Was this translation helpful? Give feedback.
All reactions