Class: Phut::Parser
- Inherits:
-
Object
- Object
- Phut::Parser
- Defined in:
- lib/phut/parser.rb
Overview
Configuration DSL parser.
Instance Method Summary collapse
-
#initialize(logger = NullLogger.new) ⇒ Parser
constructor
A new instance of Parser.
- #parse(file) ⇒ Object
Constructor Details
#initialize(logger = NullLogger.new) ⇒ Parser
Returns a new instance of Parser.
8 9 10 |
# File 'lib/phut/parser.rb', line 8 def initialize(logger = NullLogger.new) @logger = logger end |
Instance Method Details
#parse(file) ⇒ Object
12 13 14 15 16 17 |
# File 'lib/phut/parser.rb', line 12 def parse(file) Configuration.new(@logger).tap do |configuration| Syntax.new(configuration).instance_eval IO.read(file), file configuration.update_connections end end |