Sha256: 347f781e1f341cc48f4a1ef1f2293a56fab00da4ea04ab10cbc1e7198c9d6b44

Contents?: true

Size: 607 Bytes

Versions: 12

Compression:

Stored size: 607 Bytes

Contents

class KnowledgeBase
  def syndicate(name, kb)
    kb.all_databases.each do |database|
      db_name = [database, name] * "@"
      file, kb_options = kb.registry[database]
      options = {}
      options[:entity_options] = kb_options[:entity_options]
      options[:undirected] = true if kb_options and kb_options[:undirected]
      if kb.entity_options
        options[:entity_options] = kb.entity_options.merge(options[:entity_options] || {})
      end

      register(db_name, nil, options) do
        kb.get_database(database)
      end
    end
  end

  def all_databases
    @registry.keys 
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
rbbt-util-5.16.2 lib/rbbt/knowledge_base/syndicate.rb
rbbt-util-5.16.1 lib/rbbt/knowledge_base/syndicate.rb
rbbt-util-5.16.0 lib/rbbt/knowledge_base/syndicate.rb
rbbt-util-5.15.3 lib/rbbt/knowledge_base/syndicate.rb
rbbt-util-5.15.2 lib/rbbt/knowledge_base/syndicate.rb
rbbt-util-5.15.1 lib/rbbt/knowledge_base/syndicate.rb
rbbt-util-5.14.39 lib/rbbt/knowledge_base/syndicate.rb
rbbt-util-5.14.38 lib/rbbt/knowledge_base/syndicate.rb
rbbt-util-5.14.37 lib/rbbt/knowledge_base/syndicate.rb
rbbt-util-5.14.36 lib/rbbt/knowledge_base/syndicate.rb
rbbt-util-5.14.35 lib/rbbt/knowledge_base/syndicate.rb
rbbt-util-5.14.34 lib/rbbt/knowledge_base/syndicate.rb