Class: ArticleJSON::Import::GoogleDoc::HTML::ParagraphParser

Inherits:
Object
  • Object
show all
Defined in:
lib/article_json/import/google_doc/html/paragraph_parser.rb

Instance Method Summary collapse

Constructor Details

#initialize(node:, css_analyzer:) ⇒ ParagraphParser

Returns a new instance of ParagraphParser.

Parameters:



8
9
10
11
# File 'lib/article_json/import/google_doc/html/paragraph_parser.rb', line 8

def initialize(node:, css_analyzer:)
  @node = node
  @css_analyzer = css_analyzer
end

Instance Method Details

#contentArray[ArticleJSON::Elements::Text]

Returns:



14
15
16
# File 'lib/article_json/import/google_doc/html/paragraph_parser.rb', line 14

def content
  TextParser.extract(node: @node, css_analyzer: @css_analyzer)
end

#elementArticleJSON::Elements::Paragraph



19
20
21
# File 'lib/article_json/import/google_doc/html/paragraph_parser.rb', line 19

def element
  ArticleJSON::Elements::Paragraph.new(content: content)
end