Class: Highway::Compiler::Parse::Versions::V1
- Inherits:
-
Object
- Object
- Highway::Compiler::Parse::Versions::V1
- Defined in:
- lib/highway/compiler/parse/versions/v1.rb
Overview
This class is responsible for parsing a configuration file v1.
Instance Method Summary collapse
-
#initialize(interface:) ⇒ V1
constructor
Initialize an instance.
-
#parse(raw:) ⇒ Highway::Compiler::Parse::Tree::Root
Parse the configuration file v1.
Constructor Details
#initialize(interface:) ⇒ V1
Initialize an instance.
21 22 23 |
# File 'lib/highway/compiler/parse/versions/v1.rb', line 21 def initialize(interface:) @interface = interface end |
Instance Method Details
#parse(raw:) ⇒ Highway::Compiler::Parse::Tree::Root
Parse the configuration file v1.
30 31 32 33 34 35 36 37 38 39 40 41 |
# File 'lib/highway/compiler/parse/versions/v1.rb', line 30 def parse(raw:) parse_tree = Parse::Tree::Root.new(version: 1) validate_toplevel_keys(raw: raw) parse_variables(raw: raw, parse_tree: parse_tree) parse_steps(raw: raw, parse_tree: parse_tree) parse_tree end |