Class: ArticleJSON::Import::GoogleDoc::HTML::ParagraphParser
- Inherits:
-
Object
- Object
- ArticleJSON::Import::GoogleDoc::HTML::ParagraphParser
- Defined in:
- lib/article_json/import/google_doc/html/paragraph_parser.rb
Instance Method Summary collapse
- #content ⇒ Array[ArticleJSON::Elements::Text]
- #element ⇒ ArticleJSON::Elements::Paragraph
-
#initialize(node:, css_analyzer:) ⇒ ParagraphParser
constructor
A new instance of ParagraphParser.
Constructor Details
#initialize(node:, css_analyzer:) ⇒ ParagraphParser
Returns a new instance of ParagraphParser.
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
#content ⇒ Array[ArticleJSON::Elements::Text]
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 |
#element ⇒ ArticleJSON::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 |