Class: ElectricMonk::Config
- Inherits:
-
Object
- Object
- ElectricMonk::Config
- Defined in:
- lib/electric_monk.rb
Instance Method Summary collapse
-
#initialize(path) ⇒ Config
constructor
A new instance of Config.
- #projects ⇒ Object
- #root ⇒ Object
Constructor Details
#initialize(path) ⇒ Config
Returns a new instance of Config.
35 36 37 |
# File 'lib/electric_monk.rb', line 35 def initialize(path) @config = TomlRB.load_file(path) end |
Instance Method Details
#projects ⇒ Object
43 44 45 46 47 48 49 50 51 |
# File 'lib/electric_monk.rb', line 43 def projects @config.fetch("projects").map do |name, attributes| Project.new( root: root, name: name, origin: attributes.fetch("origin") ) end end |
#root ⇒ Object
39 40 41 |
# File 'lib/electric_monk.rb', line 39 def root @root ||= File.(@config.fetch("root")) end |