jeudi 15 juin 2017

Put gem class into namespace

To my Rails Gemfile I added a new Gem. It get's used like this:

Email::Client

The issue i'm having right now is that I also have a class in my Rails-App that's called Email. Now sometimes when I try to initialize it I get the following error:

Email.new # >> undefined method 'new' for Email:Module

Probably because Email is a Module in the Gem. How can fix this issue? Is there a way to namespace the Gem Module? I don't want to rename the Email-Class.

Aucun commentaire:

Enregistrer un commentaire