Class: SiSU_HarvestAuthors::Index
- Inherits:
-
Object
- Object
- SiSU_HarvestAuthors::Index
- Defined in:
- lib/sisu/html_harvest_authors.rb
Instance Method Summary collapse
- #capital(txt) ⇒ Object
- #construct_book_author_index ⇒ Object
-
#initialize(idx_array, the_idx) ⇒ Index
constructor
A new instance of Index.
Constructor Details
#initialize(idx_array, the_idx) ⇒ Index
Returns a new instance of Index.
168 169 170 171 |
# 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 |
Instance Method Details
#capital(txt) ⇒ Object
172 173 174 |
# 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 ⇒ Object
175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 |
# File 'lib/sisu/html_harvest_authors.rb', line 175 def 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 || =.strip if @@the_idx_authors[lang][].is_a?(NilClass) @@the_idx_authors[lang][]={ md: [] } end @@the_idx_authors[lang][][: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 |