Class: Falkor::Yard::Parser
- Inherits:
-
Object
- Object
- Falkor::Yard::Parser
- Defined in:
- lib/falkor/yard/parser.rb,
lib/falkor/yard/parser/global_state.rb
Defined Under Namespace
Classes: GlobalState
Instance Attribute Summary collapse
-
#files ⇒ Object
Returns the value of attribute files.
-
#global_state ⇒ Object
Returns the value of attribute global_state.
Instance Method Summary collapse
-
#initialize(global_state, files) ⇒ Parser
constructor
A new instance of Parser.
- #parse ⇒ Object
Constructor Details
#initialize(global_state, files) ⇒ Parser
Returns a new instance of Parser.
11 12 13 14 15 |
# File 'lib/falkor/yard/parser.rb', line 11 def initialize(global_state, files) @global_state = global_state || GlobalState.new(self, 0) @files = files.dup end |
Instance Attribute Details
#files ⇒ Object
Returns the value of attribute files.
9 10 11 |
# File 'lib/falkor/yard/parser.rb', line 9 def files @files end |
#global_state ⇒ Object
Returns the value of attribute global_state.
9 10 11 |
# File 'lib/falkor/yard/parser.rb', line 9 def global_state @global_state end |
Instance Method Details
#parse ⇒ Object
17 18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/falkor/yard/parser.rb', line 17 def parse global_state.block = Proc.new if block_given? until files.empty? file = files.shift YARD::Parser::SourceParser.new( YARD::Parser::SourceParser.parser_type, global_state ).parse(file) global_state.processed(file) end end |