Ruby class

I use gem plivo. When I include the library plivoin my code, there are 2-3 classes that I use, and plivousing, therefore, my class conflicts.

Is there any way to solve this in ruby?

+4
source share
1 answer

You can use a namespace, including plivo lib.

Example:

module PlivoModule
    module Plivo
     #plivo code
    end
end

Use as: PlivoModule::Plivo::RestAPI.new

+6
source

Source: https://habr.com/ru/post/1619954/


All Articles