Class: Bake::Registry::FileLoader
- Inherits:
-
Object
- Object
- Bake::Registry::FileLoader
- Defined in:
- lib/bake/registry/directory_loader.rb
Instance Attribute Summary collapse
-
#paths ⇒ Object
readonly
Returns the value of attribute paths.
Instance Method Summary collapse
- #each(&block) ⇒ Object
-
#initialize(paths) ⇒ FileLoader
constructor
A new instance of FileLoader.
- #scope_for(path) ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(paths) ⇒ FileLoader
Returns a new instance of FileLoader.
54 55 56 |
# File 'lib/bake/registry/directory_loader.rb', line 54 def initialize(paths) @paths = paths end |
Instance Attribute Details
#paths ⇒ Object (readonly)
Returns the value of attribute paths.
62 63 64 |
# File 'lib/bake/registry/directory_loader.rb', line 62 def paths @paths end |
Instance Method Details
#each(&block) ⇒ Object
64 65 66 |
# File 'lib/bake/registry/directory_loader.rb', line 64 def each(&block) @paths.each_key(&block) end |
#scope_for(path) ⇒ Object
68 69 70 71 72 73 74 |
# File 'lib/bake/registry/directory_loader.rb', line 68 def scope_for(path) if file_path = @paths[path] if File.exist?(file_path) return Scope.load(file_path, path) end end end |
#to_s ⇒ Object
58 59 60 |
# File 'lib/bake/registry/directory_loader.rb', line 58 def to_s "#{self.class} #{@paths}" end |