Sha256: 7774905a3311acc42e35d908d17342c81437054b32bc890a54ed8433236a24bd

Contents?: true

Size: 392 Bytes

Versions: 25

Compression:

Stored size: 392 Bytes

Contents

# encoding: UTF-8

module StorageRoom
  module Plugins
    include ActiveSupport::DescendantsTracker

    def plugins
      @plugins ||= []
    end

    def plugin(mod)
      include mod
      direct_descendants.each {|model| model.send(:include, mod) }
      plugins << mod
    end

    def included(base = nil, &block)
      direct_descendants << base if base
      super
    end
  end
end

Version data entries

25 entries across 25 versions & 1 rubygems

Version Path
storage_room-0.3.24 lib/storage_room/plugins.rb
storage_room-0.3.23 lib/storage_room/plugins.rb
storage_room-0.3.22 lib/storage_room/plugins.rb
storage_room-0.3.21 lib/storage_room/plugins.rb
storage_room-0.3.20 lib/storage_room/plugins.rb
storage_room-0.3.19 lib/storage_room/plugins.rb
storage_room-0.3.18 lib/storage_room/plugins.rb
storage_room-0.3.17 lib/storage_room/plugins.rb
storage_room-0.3.16 lib/storage_room/plugins.rb
storage_room-0.3.15 lib/storage_room/plugins.rb
storage_room-0.3.14 lib/storage_room/plugins.rb
storage_room-0.3.13 lib/storage_room/plugins.rb
storage_room-0.3.12 lib/storage_room/plugins.rb
storage_room-0.3.11 lib/storage_room/plugins.rb
storage_room-0.3.10 lib/storage_room/plugins.rb
storage_room-0.3.9 lib/storage_room/plugins.rb
storage_room-0.3.8 lib/storage_room/plugins.rb
storage_room-0.3.7 lib/storage_room/plugins.rb
storage_room-0.3.6 lib/storage_room/plugins.rb
storage_room-0.3.5 lib/storage_room/plugins.rb