Class: Prick::Build::Parser
- Inherits:
-
Object
- Object
- Prick::Build::Parser
- Defined in:
- lib/prick/builder/parser.rb
Instance Attribute Summary collapse
-
#conn ⇒ Object
readonly
Returns the value of attribute conn.
-
#unit ⇒ Object
readonly
The singular RootBuildNode object.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(conn) ⇒ Parser
constructor
A new instance of Parser.
-
#parse(path, single: false) ⇒ Object
Return a RootBuildNode object.
Constructor Details
#initialize(conn) ⇒ Parser
Returns a new instance of Parser.
11 12 13 14 |
# File 'lib/prick/builder/parser.rb', line 11 def initialize(conn) @conn = conn @unit = nil end |
Instance Attribute Details
#conn ⇒ Object (readonly)
Returns the value of attribute conn.
8 9 10 |
# File 'lib/prick/builder/parser.rb', line 8 def conn @conn end |
#unit ⇒ Object (readonly)
The singular RootBuildNode object
9 10 11 |
# File 'lib/prick/builder/parser.rb', line 9 def unit @unit end |
Class Method Details
Instance Method Details
#parse(path, single: false) ⇒ Object
Return a RootBuildNode object. #path can be a file or a directory
17 18 19 20 21 22 23 24 25 |
# File 'lib/prick/builder/parser.rb', line 17 def parse(path, single: false) File.exist?(path) or raise Error, "Can't find #{path}" if single parse_path(path) else parse_directory(nil, path) end self end |