Class: Asuka::Rules::Paragraph

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

override

Returns:

  • (Boolean)


44
45
46
# File 'lib/asuka/rules.rb', line 44

def match?(line)
  true # paragraph match everything!
end

#process(line) ⇒ Object



52
53
54
# File 'lib/asuka/rules.rb', line 52

def process(line)
  acc.push(line_formatter.format(line))
end

#transitionObject



48
49
50
# File 'lib/asuka/rules.rb', line 48

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