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

get url and add instance to a model with prefilled foreign key :django admin -

css - Make div keyboard-scrollable in jQuery Mobile? -

ruby on rails - Seeing duplicate requests handled with Unicorn -