Class: DGD::Doc::SourceFile
- Inherits:
-
Object
- Object
- DGD::Doc::SourceFile
- Defined in:
- lib/dgd-tools/dgd-doc.rb
Instance Attribute Summary collapse
-
#parser ⇒ Object
readonly
Returns the value of attribute parser.
Instance Method Summary collapse
-
#initialize(path, dgd_root:) ⇒ SourceFile
constructor
A new instance of SourceFile.
Constructor Details
#initialize(path, dgd_root:) ⇒ SourceFile
Returns a new instance of SourceFile.
17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/dgd-tools/dgd-doc.rb', line 17 def initialize(path, dgd_root:) unless File.exist?(path) raise "No such source file for DGD::Doc::Sourcefile: #{path.inspect}" end @parser = DGDGrammarParser.new @path = path @dgd_root = dgd_root parse_contents end |
Instance Attribute Details
#parser ⇒ Object (readonly)
Returns the value of attribute parser.
15 16 17 |
# File 'lib/dgd-tools/dgd-doc.rb', line 15 def parser @parser end |