class AozoraSsml::Document
Attributes
main_text[R]
title[R]
Public Class Methods
new(title, author, main_text)
click to toggle source
# File lib/aozora-ssml/document.rb, line 15 def initialize(title, author, main_text) @title = title @author = author @main_text = main_text end
parse(html)
click to toggle source
# File lib/aozora-ssml/document.rb, line 7 def self.parse(html) doc = Nokogiri::HTML.parse(html) title = doc.xpath('//h1').text author = doc.xpath('//h2').text main_text = doc.xpath('//div[@class="main_text"]').to_html new(title, author, main_text) end