Sha256: 4d5a40b275935237ebd7d7de9de82df00f163ff67530c60ab48c38a527e62ea2
Contents?: true
Size: 631 Bytes
Versions: 9
Compression:
Stored size: 631 Bytes
Contents
module Netzke::Core module Plugins extend ActiveSupport::Concern included do # Returns registered plugins class_attribute :registered_plugins self.registered_plugins = [] end module ClassMethods # Defines a plugin def plugin(name, &block) register_plugin(name) component name, eager_load: true do |c| block.call(c) if block_given? end end private # Register a plugin def register_plugin(name) self.registered_plugins |= [name] end end def plugins self.class.registered_plugins end end end
Version data entries
9 entries across 9 versions & 1 rubygems