Class: Aozoragen::SaiZenSenRegular
- Defined in:
- lib/aozoragen/sai-zen-sen.rb
Instance Method Summary collapse
- #each_chapter ⇒ Object
-
#initialize(index_uri) ⇒ SaiZenSenRegular
constructor
A new instance of SaiZenSenRegular.
- #metainfo ⇒ Object
Methods inherited from SaiZenSen
#each_chapter_local, #get_chapter_text
Methods included from Util
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_chapter ⇒ Object
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 |
#metainfo ⇒ Object
84 85 86 87 88 89 90 91 |
# File 'lib/aozoragen/sai-zen-sen.rb', line 84 def 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 || info[:author] << .text.sub( /.*? /, '' ) end info end |