I have a module Helper which is present in app/models/concerns/helper.rb
module Helper
def func
return ['A', 'B', 'C']
end
end
I have a class NewService which is present in app/services/pqr/new_service.rb
module PQR
class NewService < ApplicationService
include Helper
@@results = func
def self.another_func
if @@results.blank?
@@results = func
end
end
end
end
On calling the function: PQR::NewService.another_func
I am getting the error: (undefined local variable or method func for PQR::NewService:Class)
Ruby version - 2.5.3
Rails version - 5.2.3