Sha256: 3e534e52d7701dd6d855f0b2bea0ab83be6e5eae55e831a72f1b6b7e20a87532

Contents?: true

Size: 475 Bytes

Versions: 5

Compression:

Stored size: 475 Bytes

Contents

module Spina
  class Plugin

    attr_accessor :name, :namespace

    class << self

      def all
        ::Spina::PLUGINS
      end

      def find_by_name(name)
        all.find { |plugin| plugin.name == name }
      end

      def register
        plugin = new
        yield plugin
        raise 'Missing plugin name' if plugin.name.nil?
        raise 'Missing plugin namespace' if plugin.namespace.nil?
        all << plugin
        plugin
      end

    end

  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
spina-0.12.0 lib/spina/plugin.rb
spina-0.11.1 lib/spina/plugin.rb
spina-0.11.0 lib/spina/plugin.rb
spina-0.10.0 lib/spina/plugin.rb
spina-0.9.0 lib/spina/plugin.rb