Class: Asuka::Rules::Blockquote

Inherits:
Abstract
  • Object
show all
Defined in:
lib/asuka/rules.rb

Instance Attribute Summary

Attributes inherited from Abstract

#acc, #line_formatter, #result

Instance Method Summary collapse

Methods inherited from Abstract

#initialize

Constructor Details

This class inherits a constructor from Asuka::Rules::Abstract

Instance Method Details

#match?(line) ⇒ Boolean

Returns:

  • (Boolean)


58
59
60
# File 'lib/asuka/rules.rb', line 58

def match?(line)
  line =~ /^> /
end

#process(line) ⇒ Object



66
67
68
# File 'lib/asuka/rules.rb', line 66

def process(line)
  acc.push(line_formatter.format(line[5..-1]))
end

#transitionObject



62
63
64
# File 'lib/asuka/rules.rb', line 62

def transition
  result << Asuka::Blockquote.new(acc.flush)
end