Sha256: cad3b600e7bf5e6612e54ceedd8a3ee1604c72880649518d6d9e9d3a667b72e5

Contents?: true

Size: 521 Bytes

Versions: 1

Compression:

Stored size: 521 Bytes

Contents

module Ro
  class Db
    fattr :root

    def initialize(*args, &block)
      options = Map.options_for!(args)

      @root = String(args.shift || options[:root] || Ro.root)
    end

    def collections
      @collections ||= Collection::List.new

      Dir.glob(glob){|path| @collections.add(path)}

      @collections
    end

    def glob
      File.join(root, '*')
    end

    def nodes(*args, &block)
      collections.map do |collection|
        collection.nodes(*args, &block)
      end.flatten
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
ro-1.0.0 lib/ro/db.rb