Class: Aozoragen::SaiZenSenRegular

Inherits:
SaiZenSen
  • Object
show all
Defined in:
lib/aozoragen/sai-zen-sen.rb

Instance Method Summary collapse

Methods inherited from SaiZenSen

#each_chapter_local, #get_chapter_text

Methods included from Util

#detag

Constructor Details

#initialize(index_uri) ⇒ SaiZenSenRegular

Returns a new instance of SaiZenSenRegular.



79
80
81
82
# File 'lib/aozoragen/sai-zen-sen.rb', line 79

def initialize( index_uri )
	@index_uri = index_uri
	@index_html = Nokogiri( open( @index_uri, 'r:utf-8', &:read ) )
end

Instance Method Details

#each_chapterObject



93
94
95
# File 'lib/aozoragen/sai-zen-sen.rb', line 93

def each_chapter
	each_chapter_local( '#back-numbers li a' ){|c| yield c}
end

#metainfoObject



84
85
86
87
88
89
90
91
# File 'lib/aozoragen/sai-zen-sen.rb', line 84

def metainfo
	info = {:id => Pathname( @index_uri.path ).basename.to_s, :author => []}
	info[:title] = (@index_html / '#page-content-heading h1')[0].text
	(@index_html / '#authors h3').each do |author|
		info[:author] << author.text.sub( /.*? /, '' )
	end
	info
end