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++: Boost interprocess memory mapped file error -

python - IO.UnsupportedOperation: Not Writable -

python - Selecting distinct values from a column in Peewee -