I have an array in my model but I don't know how to access it from some defs in this model
private
topics =
[
'en','Sports','sports',
'en','Sports,Soccer,Football','soccer,football',
]
def self.load
topics.each_slice(3).map do |lang,tags,searchterms|
load_data(lang,tags,searchterms)
end
end
But when I try from to execute from console it shows an error
NameError: undefined local variable or method `topics' for Class:
I don't want to declare the array inside def because I need other methods from model can access to this array
Any idea? thanks