class SiSU_HarvestAuthors::Index

Public Class Methods

new(idx_array,the_idx) click to toggle source
# File lib/sisu/html_harvest_authors.rb, line 168
def initialize(idx_array,the_idx)
  @idx_array,@the_idx=idx_array,the_idx
  @@the_idx_authors=@the_idx
end

Public Instance Methods

capital(txt) click to toggle source
# File lib/sisu/html_harvest_authors.rb, line 172
def capital(txt)
  txt[0].chr.capitalize + txt[1,txt.length]
end
construct_book_author_index() click to toggle source
# File lib/sisu/html_harvest_authors.rb, line 175
def construct_book_author_index
  idx_array=@idx_array
  idx_array.each_pair do |lang,idx_arr|
    @@the_idx_authors[lang] ||= {}
    idx_arr.each do |idx|
      idx[:author][:last_first_format_a].each do |author|
        author=author.strip
        if @@the_idx_authors[lang][author].is_a?(NilClass)
          @@the_idx_authors[lang][author]={ md: [] }
        end
        @@the_idx_authors[lang][author][:md] << {
          filename: idx[:filename],
          file: idx[:file],
          author: idx[:author],
          title: idx[:title],
          date: idx[:date],
          page: idx[:page],
          lang: idx[:lang]
        }
      end
    end
  end
  @the_idx=@@the_idx_authors
end