class Puma::PluginLoader - puma-3.10.0 Documentation

# class Puma::PluginLoader

### Public Class Methods

new() click to toggle source

    # File lib/puma/plugin.rb, line 5
    def initialize
      @instances = []
    end

### Public Instance Methods

create(name) click to toggle source

    # File lib/puma/plugin.rb, line 9
    def create(name)
      if cls = Plugins.find(name)
        plugin = cls.new(Plugin)
        @instances << plugin
        return plugin
      end

      raise UnknownPlugin, "File failed to register properly named plugin"
    end

fire_starts(launcher) click to toggle source

    # File lib/puma/plugin.rb, line 19
    def fire_starts(launcher)
      @instances.each do |i|
        if i.respond_to? :start
          i.start(launcher)
        end
      end
    end