class Deba::Document
Constants
- BLOCKQUOTE
Attributes
content[R]
Public Class Methods
new(extractor)
click to toggle source
# File lib/deba/document.rb, line 6 def initialize(extractor) @extractor = extractor @content = "" start end
Public Instance Methods
<<(segment)
click to toggle source
# File lib/deba/document.rb, line 13 def <<(segment) @segments << segment end
block_content()
click to toggle source
# File lib/deba/document.rb, line 38 def block_content block_type = @args.shift @args.unshift(@segments) Deba::Stringifier.new(block_type.new(*@args).to_a).stringify end
break(*args)
click to toggle source
# File lib/deba/document.rb, line 17 def break(*args) finish start(*args) end
finish()
click to toggle source
# File lib/deba/document.rb, line 22 def finish return unless present? @content << BLOCKQUOTE if @extractor.in_blockquote? @content << block_content end
present?()
click to toggle source
# File lib/deba/document.rb, line 34 def present? @segments.any? { |segment| segment.is_a?(Deba::Span) && Deba::Utils.present?(segment.to_s) } end
start(*args)
click to toggle source
# File lib/deba/document.rb, line 29 def start(*args) @segments = [] @args = args end