Module: Pic2ch::Thread::ElementParser

Defined in:
lib/pic2ch/thread/element_parser.rb

Class Method Summary collapse

Class Method Details

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



4
5
6
7
8
9
10
11
# File 'lib/pic2ch/thread/element_parser.rb', line 4

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