Sha256: 7f6d831d5ec9a762bfdf1f9115516160254bf5e6bf1d5cc98ba675c73659f98d

Contents?: true

Size: 517 Bytes

Versions: 4

Compression:

Stored size: 517 Bytes

Contents

module Watir

  class Browser
    attr_reader :doc

    #
    # Store instance of Nokogiri
    #

    def doc=(html)
      @doc = html
      return if html.nil?

      @reset_doc_hook = ->(browser) { browser.reset_doc }
      after_hooks.add(@reset_doc_hook)
    end

    def reset_doc
      @doc = nil
      after_hooks.delete(@reset_doc_hook)
    end

    #
    # Uses Nokogiri to return the text of page body.
    #
    # @return [String]
    #

    def text!
      body.text!
    end

  end # Browser
end # Watir

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
watigiri-0.4.0 lib/extensions/watir/browser.rb
watigiri-0.3.2 lib/extensions/watir/browser.rb
watigiri-0.3.1 lib/extensions/watir/browser.rb
watigiri-0.3.0 lib/extensions/watir/browser.rb