Class: YARDJS::Parser::JavaScriptParser

Inherits:
YARD::Parser::Base
  • Object
show all
Defined in:
lib/yard-js/parser.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(source, filename) ⇒ 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

#astObject

Returns the value of attribute ast


6
7
8
# File 'lib/yard-js/parser.rb', line 6

def ast
  @ast
end

#fileObject

Returns the value of attribute file


6
7
8
# File 'lib/yard-js/parser.rb', line 6

def file
  @file
end

#sourceObject

Returns the value of attribute source


6
7
8
# File 'lib/yard-js/parser.rb', line 6

def source
  @source
end

Instance Method Details

#enumeratorObject


18
19
20
# File 'lib/yard-js/parser.rb', line 18

def enumerator
  ast.elements
end

#parseObject


13
14
15
16
# File 'lib/yard-js/parser.rb', line 13

def parse
  self.ast = ParseJS.parse(source)
  self
end