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++ - llvm function pass ReplaceInstWithInst malloc -

Cross-Compiling Linux Kernel for Raspberry Pi - ${CCPREFIX}gcc -v does not work -

java.lang.NoClassDefFoundError When Creating New Android Project -