Sha256: e23b0844032a6d296eb1a29522637ab166ae5b9438c280fb14ed9159003d5cd7

Contents?: true

Size: 862 Bytes

Versions: 24

Compression:

Stored size: 862 Bytes

Contents

module MasterView

  # mix this in so that these become class methods
  # mix in like so
  # class FooPluginBase
  #     include PluginLoadTracking
  # end
  module PluginLoadTracking

    module InstanceMethods
      #put any instance methods here
    end

    module ClassMethods
      @@loaded_classes = []

      # called when a class inherits from this
      def inherited(plugin_class)
        self.register_class(plugin_class)
      end

      # register a loaded class, called from inherited and can be called manually.
      def register_class(plugin_class)
        @@loaded_classes << plugin_class
      end

      def loaded_classes
        @@loaded_classes
      end

    end

    def self::included(other_module)
      other_module.module_eval{ include InstanceMethods }
      other_module.extend ClassMethods
      other_module
    end

  end

end

Version data entries

24 entries across 24 versions & 2 rubygems

Version Path
masterview-0.0.17 lib/masterview/plugin_load_tracking.rb
masterview-0.0.12 lib/masterview/plugin_load_tracking.rb
masterview-0.0.10 lib/masterview/plugin_load_tracking.rb
masterview-0.0.13 lib/masterview/plugin_load_tracking.rb
masterview-0.0.11 lib/masterview/plugin_load_tracking.rb
masterview-0.0.14 lib/masterview/plugin_load_tracking.rb
masterview-0.0.15 lib/masterview/plugin_load_tracking.rb
masterview-0.0.16 lib/masterview/plugin_load_tracking.rb
masterview-0.0.2 lib/masterview/plugin_load_tracking.rb
masterview-0.2.1 lib/masterview/plugin_load_tracking.rb
masterview-0.0.8 lib/masterview/plugin_load_tracking.rb
masterview-0.0.9 lib/masterview/plugin_load_tracking.rb
masterview-0.1.0 lib/masterview/plugin_load_tracking.rb
masterview-0.1.1 lib/masterview/plugin_load_tracking.rb
masterview-0.0.7 lib/masterview/plugin_load_tracking.rb
masterview-0.1.2 lib/masterview/plugin_load_tracking.rb
masterview-0.1.3 lib/masterview/plugin_load_tracking.rb
masterview-0.1.5 lib/masterview/plugin_load_tracking.rb
masterview-0.2.0 lib/masterview/plugin_load_tracking.rb
masterview-0.2.2 lib/masterview/plugin_load_tracking.rb