Class: YARDJS::Parser::JavaScriptParser
- Inherits:
-
YARD::Parser::Base
- Object
- YARD::Parser::Base
- YARDJS::Parser::JavaScriptParser
- Defined in:
- lib/yard-js/parser.rb
Instance Attribute Summary collapse
-
#ast ⇒ Object
Returns the value of attribute ast.
-
#file ⇒ Object
Returns the value of attribute file.
-
#source ⇒ Object
Returns the value of attribute source.
Instance Method Summary collapse
- #enumerator ⇒ Object
-
#initialize(source, filename) ⇒ JavaScriptParser
constructor
A new instance of JavaScriptParser.
- #parse ⇒ Object
Constructor Details
#initialize(source, filename) ⇒ JavaScriptParser
Returns a new instance of JavaScriptParser.
8 9 10 11 |
# File 'lib/yard-js/parser.rb', line 8 def initialize(source, filename) self.source = source self.file = filename end |
Instance Attribute Details
#ast ⇒ Object
Returns the value of attribute ast.
6 7 8 |
# File 'lib/yard-js/parser.rb', line 6 def ast @ast end |
#file ⇒ Object
Returns the value of attribute file.
6 7 8 |
# File 'lib/yard-js/parser.rb', line 6 def file @file end |
#source ⇒ Object
Returns the value of attribute source.
6 7 8 |
# File 'lib/yard-js/parser.rb', line 6 def source @source end |
Instance Method Details
#enumerator ⇒ Object
18 19 20 |
# File 'lib/yard-js/parser.rb', line 18 def enumerator ast.elements end |
#parse ⇒ Object
13 14 15 16 |
# File 'lib/yard-js/parser.rb', line 13 def parse self.ast = ParseJS.parse(source) self end |