class NcodeSyosetu::Model::Episode
Attributes
body_html[RW]
number[RW]
title[RW]
url[RW]
Public Class Methods
new(title, number, page)
click to toggle source
# File lib/ncode_syosetu/model/episode.rb, line 8 def initialize(title, number, page) @url = page.uri.to_s @title = title @number = number @body_html = page.search(".novel_subtitle").to_html << page.search(".novel_view").to_html end
Public Instance Methods
html()
click to toggle source
# File lib/ncode_syosetu/model/episode.rb, line 18 def html <<-HTML <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="ja" lang="ja"> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <title>#{@title}</title> </head> <body> #{@body_html} </body> </html> HTML end