Sha256: c4a4f6f8678aabe1daf37b71e187c44050b6d294ca86dc5a202e16a93a363b77
Contents?: true
Size: 695 Bytes
Versions: 18
Compression:
Stored size: 695 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 do |c| block.call(c) if block_given? # plugins are *always* eagerly loaded c.eager_loading = true 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
18 entries across 18 versions & 1 rubygems