I am unable to overwrite the module variable by class instance variable.
module Main
class Traks
@@endpoint ='/trakings'
class << self
include ViewTrait
end
end
end
My Trait Module
module Main
module ViewTrait
def view(id:, options: "")
Response::new("#{@@endpoint}/#{id}#{options}").resource(id: id).get
end
end
end
in ViewTrait I cannot access @@endponint
which I have already defined in my Traks class. anyone can let me what I went wrong.
Aucun commentaire:
Enregistrer un commentaire