Class: Documentary::Parser

Inherits:
Object
  • Object
show all
Defined in:
lib/documentary/parser.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(path) ⇒ Parser

Returns a new instance of Parser.



5
6
7
8
9
10
11
12
13
14
# File 'lib/documentary/parser.rb', line 5

def initialize(path)
  @path = path
  @docblocks = []
  @line_number = 0
  begin
    parse_file
  rescue Psych::SyntaxError
    raise Documentary::InvalidDocblock.new form_exception_message
  end
end

Instance Attribute Details

#docblocksObject (readonly)

Returns the value of attribute docblocks.



16
17
18
# File 'lib/documentary/parser.rb', line 16

def docblocks
  @docblocks
end