Sha256: c79e8b5e06d3b379dd0eb7f177a25de3e95291650ce5b89f55f13e94ebe9105e

Contents?: true

Size: 557 Bytes

Versions: 1

Compression:

Stored size: 557 Bytes

Contents

require 'registrable'

class Plugin

  extend Registrable

  def initialize(name)
    @name = name
  end

  attr_reader :name

end

unless ENV['RSPEC'] # Not loading this file from tests
  p Plugin.register(:my_plugin, 'My Plugin') # => #<Plugin:0x0001 @name="My Plugin">
  p Plugin.registered?(:my_plugin)           # => true
  p Plugin.registry[:my_plugin]              # => #<Plugin:0x0001 @name="My Plugin">
  p Plugin.unregister(:my_plugin)            # => #<Plugin:0x0001 @name="My Plugin">
  p Plugin.registered?(:my_plugin)           # => false
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
registrable-0.1.0 examples/plugin.rb