Module: Pic2ch::Parsers::Index::ElementParser

Defined in:
lib/pic2ch/parsers/index.rb

Class Method Summary collapse

Class Method Details

.next_class_for(e, name, limit = 10, &block) ⇒ Object



5
6
7
8
9
10
11
12
# File 'lib/pic2ch/parsers/index.rb', line 5

def self.next_class_for(e, name, limit = 10, &block)
  limit.times do
    e = e.next or return nil
    next unless e["class"] == name.to_s
    return block ? block.call(e) : e
  end
  return nil
end