Sha256: c3d5743c361c3aff72a3e182c2cb14491990b18263c41157fd8a7a974b81bf64

Contents?: true

Size: 695 Bytes

Versions: 11

Compression:

Stored size: 695 Bytes

Contents

require File.join %w(admin_it data data_behavior)
require File.join %w(admin_it data object)
require File.join %w(admin_it data hash)
require File.join %w(admin_it data active_record)

module AdminIt
  def self.register_data(entity_class, mod)
    return if entity_class.nil?
    @data_modules ||= []
    @data_modules.unshift [entity_class, mod]
  end

  def self.data_module(entity_class)
    return nil if entity_class.nil?
    @data_modules ||= []
    @data_modules.each do |mod|
      return mod[1] if entity_class <= mod[0]
    end
  end

  register_data Object, AdminIt::ObjectData
  register_data Hash, AdminIt::HashData
  register_data ActiveRecord::Base, AdminIt::ActiveRecordData
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
admin_it-1.0.11 lib/admin_it/data.rb
admin_it-1.0.10 lib/admin_it/data.rb
admin_it-1.0.9 lib/admin_it/data.rb
admin_it-1.0.8 lib/admin_it/data.rb
admin_it-1.0.7 lib/admin_it/data.rb
admin_it-1.0.6 lib/admin_it/data.rb
admin_it-1.0.5 lib/admin_it/data.rb
admin_it-1.0.4 lib/admin_it/data.rb
admin_it-1.0.3 lib/admin_it/data.rb
admin_it-1.0.2 lib/admin_it/data.rb
admin_it-1.0.1 lib/admin_it/data.rb