Class: MarkdownMetrics::LineTopElement

Inherits:
Object
  • Object
show all
Defined in:
lib/markdown_metrics/line_top_element.rb

Constant Summary collapse

ELEMENTS =
[
  MarkdownMetrics::Elements::Block::List,
  MarkdownMetrics::Elements::Block::Pre,
  MarkdownMetrics::Elements::Block::Quote,
  MarkdownMetrics::Elements::Block::Table,
  MarkdownMetrics::Elements::Inline::H1,
  MarkdownMetrics::Elements::Inline::H2,
  MarkdownMetrics::Elements::Inline::H3,
  MarkdownMetrics::Elements::Inline::H4,
  MarkdownMetrics::Elements::Inline::H5,
  MarkdownMetrics::Elements::Inline::H6,
  MarkdownMetrics::Elements::Inline::Image,
  MarkdownMetrics::Elements::Inline::Pre,
  MarkdownMetrics::Elements::Inline::EmptyLine,
  MarkdownMetrics::Elements::Inline::Paragraph
].freeze

Class Method Summary collapse

Class Method Details

.match_element(line, next_line) ⇒ Object



22
23
24
25
26
# File 'lib/markdown_metrics/line_top_element.rb', line 22

def self.match_element(line, next_line)
  ELEMENTS.find do |element_class|
    element_class.match_element(line, next_line)
  end
end