Sha256: 1b06d13503f7c55799dc8135e9802201f6537ac15ab8e2b2c3ff0c12696a948c

Contents?: true

Size: 277 Bytes

Versions: 2

Compression:

Stored size: 277 Bytes

Contents

require 'hpricot'
class Hpricot::Elem
  def all_text
    text = ''
    children.each do |child|
      if child.respond_to? :content
        text << child.content
      end
      if child.respond_to? :all_text
        text << child.all_text
      end
    end
    text
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
mechanize-0.6.1 lib/mechanize/hpricot.rb
mechanize-0.6.2 lib/mechanize/hpricot.rb