Re: dynamic loading and unloading of module

Chris Roerig <[email protected]> Sun, 18 Aug 2019 06:30:34 -0500
Newsgroups gmane.comp.lang.ruby.general
Message-ID <CAAwyNq7JZOvwP1H03fcctJeecZf8L3G3ECsH193NMSct27cPcw@mail.gmail.com>
Hi. You can’t “remove” them but you can replace them by calling the factory
again. My thought was to stuff the functionality needed into dedicated
classes and swap that functionality as the need changes. That being said,
it’s only one way to address the issue.

Cheers

On Sun, Aug 18, 2019 at 6:28 AM Robert Klemme <[email protected]>
wrote:

>
>
> On Fri, Aug 16, 2019 at 1:10 PM Chris Roerig <[email protected]> wrote:
>
>> I wouldn’t use a module here. Sounds like the factory pattern might be a
>> better option.
>>
>
> I do not think so. To me this looks like an item that can play different
> roles at different times or gain capabilities and have them removed.
> Factory just allows variants for creation but then capabilities are fixed.
> Certainly you cannot remove something after creation with the factory
> pattern.
>
> Kind regards
>
> robert
>
> --
> [guy, jim, charlie].each {|him| remember.him do |as, often| as.you_can -
> without end}
> http://blog.rubybestpractices.com/
>
> Unsubscribe: <mailto:[email protected]?subject=unsubscribe>
> <http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-talk>
>


Unsubscribe: <mailto:[email protected]?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-talk>