class ReVIEW::Book::ColumnIndex
Constants
- COLUMN_PATTERN
- Item
Public Class Methods
parse(src, *_args)
click to toggle source
# File lib/review/book/index.rb, line 344 def self.parse(src, *_args) items = [] seq = 1 src.each do |line| m = COLUMN_PATTERN.match(line) next unless m _level = m[1] ## not use it yet id = m[2] caption = m[3].strip id = caption if id.nil? || id.empty? items.push item_class.new(id, seq, caption) seq += 1 end new(items) end