Class: ReVIEW::Book::IconIndex

Inherits:
ImageIndex show all
Defined in:
lib/review/book/index.rb

Class Method Summary collapse

Methods inherited from ImageIndex

#find_pathes, #initialize, item_type

Methods inherited from Index

#[], #each, #has_key?, #initialize, item_class, #item_type, #number

Constructor Details

This class inherits a constructor from ReVIEW::Book::ImageIndex

Class Method Details

.parse(src, *args) ⇒ Object



207
208
209
210
211
212
213
214
215
216
217
# File 'lib/review/book/index.rb', line 207

def IconIndex.parse(src, *args)
  items = []
  seq = 1
  src.grep(%r!@<icon>!) do |line|
    line.gsub(/@<icon>\{(.+?)\}/) do |m|
      items.push item_class().new($1, seq)
      seq += 1
    end
  end
  new(items, *args)
end