is there something like 'with_indifferent_access' for arrays usable for include?
ruby, ruby-on-rails
Solution
a = ['std','elliptic', :cubic].map(&:to_sym)
a.include? :std
#=> true
Edit - regarding the comment by maxigs probably better to convert to strings:
a = ['std', 'elliptic', :cubic].map(&:to_s)
a.include? "std"
#=> true
Problem
I try to only use :symbols for key words in my app. I try to strict decide between :symbol => logic or string => UI/language specific But I get some "values" (ie. options and so on) per JSON, too, since there are no :symbols in JSON, all my invoked hashes have the "with_indifferent_access" attribute. but: is there something equal for array? like that ``` a=['std','elliptic', :cubic].with_indifferent_access a.include? :std => true ``` ? edit: added rails to tags