Class: Polygon::Database::Entries

Inherits:
Object
  • Object
show all
Defined in:
lib/polygon/database.rb

Instance Method Summary collapse

Constructor Details

#initialize(root, options) ⇒ Entries

Returns a new instance of Entries.



49
50
51
52
# File 'lib/polygon/database.rb', line 49

def initialize(root, options)
  @root    = root
  @options = options
end

Instance Method Details

#compilerObject



64
65
66
# File 'lib/polygon/database.rb', line 64

def compiler
  nil
end

#eachObject



54
55
56
57
58
59
60
61
62
# File 'lib/polygon/database.rb', line 54

def each
  return to_enum unless block_given?
  extensions = @options[:extensions]
  @root.glob("**/*").each do |file|
    next unless file.file? and extensions.include?(file.ext)
    entry = Entry.new(@root, file % @root)
    yield(:entry => entry)
  end
end

#to_relationObject



68
69
70
# File 'lib/polygon/database.rb', line 68

def to_relation
  Relation(each.to_a)
end