Class: Asuka::Rules::Header
Instance Attribute Summary
Attributes inherited from Abstract
#acc, #line_formatter, #result
Instance Method Summary collapse
Methods inherited from Abstract
Constructor Details
This class inherits a constructor from Asuka::Rules::Abstract
Instance Method Details
#match?(line) ⇒ Boolean
96 97 98 |
# File 'lib/asuka/rules.rb', line 96 def match?(line) line =~ /^\#{1,6} / end |
#process(line) ⇒ Object
100 101 102 103 |
# File 'lib/asuka/rules.rb', line 100 def process(line) level = line[/^\#{1,6}/].size result << Asuka::Header.new(line_formatter.format(line[level+1..-1]), level) end |