Class: Vivlio::Starter::CLI::PreProcessCommands::CrossReferenceProcessor::LabelCollectorContext
- Inherits:
-
Object
- Object
- Vivlio::Starter::CLI::PreProcessCommands::CrossReferenceProcessor::LabelCollectorContext
- Defined in:
- lib/vivlio/starter/cli/pre_process/cross_reference_processor.rb
Overview
ラベル収集用コンテキスト
Instance Method Summary collapse
- #collect(content) ⇒ Object
-
#initialize(source_file, chapter_number) ⇒ LabelCollectorContext
constructor
A new instance of LabelCollectorContext.
Constructor Details
#initialize(source_file, chapter_number) ⇒ LabelCollectorContext
Returns a new instance of LabelCollectorContext.
143 144 145 146 147 148 149 150 151 |
# File 'lib/vivlio/starter/cli/pre_process/cross_reference_processor.rb', line 143 def initialize(source_file, chapter_number) @source_file = source_file @chapter_number = chapter_number @labels = [] @errors = [] @counters = Hash.new(0) @in_code = false @fence_marker = nil end |
Instance Method Details
#collect(content) ⇒ Object
153 154 155 156 157 |
# File 'lib/vivlio/starter/cli/pre_process/cross_reference_processor.rb', line 153 def collect(content) lines = content.lines lines.each_with_index { |line, idx| process_line(line, idx, lines) } { labels: @labels, errors: @errors } end |