ruby - Is there an inversish method for `Array#include?`? -


i've wondered if there inverse method include?. given:

str = "a" ary = ["a", "b", "c"] 

i can check if string in array rather if array contains string. like:

str.in?(ary) 

i can't think of situation necessary, think direction rather other way around.

there no such method in ruby itself, there such method in rails - object#in


Comments

Popular posts from this blog

c - How to retrieve a variable from the Apache configuration inside the module? -

c# - Constructor arguments cannot be passed for interface mocks -

python - malformed header from script index.py Bad header -