Class: Aozoragen::SaiZenSenFateZero
- Defined in:
- lib/aozoragen/sai-zen-sen.rb
Instance Method Summary collapse
- #each_chapter ⇒ Object
-
#initialize(index_uri) ⇒ SaiZenSenFateZero
constructor
A new instance of SaiZenSenFateZero.
- #metainfo ⇒ Object
Methods inherited from SaiZenSen
#each_chapter_local, #get_chapter_text
Methods included from Util
Constructor Details
#initialize(index_uri) ⇒ SaiZenSenFateZero
Returns a new instance of SaiZenSenFateZero.
120 121 122 123 |
# File 'lib/aozoragen/sai-zen-sen.rb', line 120 def initialize( index_uri ) @index_uri = index_uri @index_html = Nokogiri( open( @index_uri, 'r:utf-8', &:read ) ) end |
Instance Method Details
#each_chapter ⇒ Object
134 135 136 |
# File 'lib/aozoragen/sai-zen-sen.rb', line 134 def each_chapter each_chapter_local( 'article a' ){|c| yield c} end |
#metainfo ⇒ Object
125 126 127 128 129 130 131 132 |
# File 'lib/aozoragen/sai-zen-sen.rb', line 125 def info = { :id => Pathname( @index_uri.path ).basename.to_s, :author => ['虚淵玄'] } info[:title] = (@index_html / 'h1 img')[0].attr( 'alt' ) info end |