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
Post a Comment