Sha256: bd44eddc673f821c6bd1a9d443b83c199a70ec47fb8001eee43d2cf3c0d820b6

Contents?: true

Size: 315 Bytes

Versions: 2

Compression:

Stored size: 315 Bytes

Contents

module Annal
  class Collection
    attr_accessor :dir
    def initialize(dir)
      self.dir = dir
    end

    def file_paths(glob_match = '*')
      Dir.glob("#{dir}/#{glob_match}").select {|path| File.file?(path) }
    end

    def documents
      file_paths.collect {|fp| Document.find(fp) }
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
annal-0.0.3 lib/annal/collection.rb
annal-0.0.2 lib/annal/collection.rb