Sha256: 4a5e00153a93cb4181647677266c128e5268a384f88d52716980cca27472cf6b

Contents?: true

Size: 577 Bytes

Versions: 30

Compression:

Stored size: 577 Bytes

Contents

module Webrat

  class Element # :nodoc:

    def self.load_all(session, dom)
      dom.xpath(*xpath_search).map do |element|
        load(session, element)
      end
    end

    def self.load(session, element)
      return nil if element.nil?
      session.elements[element.path] ||= self.new(session, element)
    end

    attr_reader :element

    def initialize(session, element)
      @session  = session
      @element  = element
    end

    def path
      @element.path
    end

    def inspect
      "#<#{self.class} @element=#{element.inspect}>"
    end

  end

end

Version data entries

30 entries across 30 versions & 15 rubygems

Version Path
diabolo-webrat-0.5.1 lib/webrat/core/elements/element.rb
radiant-1.0.0 ruby-debug/ruby/1.8/gems/webrat-0.7.3/lib/webrat/core/elements/element.rb
indirect-webrat-0.7.5 lib/webrat/core/elements/element.rb
indirect-webrat-0.7.4 lib/webrat/core/elements/element.rb
webrat-0.7.3 lib/webrat/core/elements/element.rb
jbd-webrat-0.7.2.rails3 lib/webrat/core/elements/element.rb
webrat-0.7.2 lib/webrat/core/elements/element.rb
webrat-0.7.2.beta.2 lib/webrat/core/elements/element.rb
mutle-webrat-0.7.2.beta.1 lib/webrat/core/elements/element.rb
thoughtbot-webrat-0.7.2.pre lib/webrat/core/elements/element.rb
webrat-0.7.2.beta.1 lib/webrat/core/elements/element.rb
honkster-webrat-0.7.1.2 lib/webrat/core/elements/element.rb
honkster-webrat-0.7.1.1 lib/webrat/core/elements/element.rb
revo-webrat-0.7.0.1 lib/webrat/core/elements/element.rb
webrat-0.7.1 lib/webrat/core/elements/element.rb
davidtrogers-webrat-0.7.0 lib/webrat/core/elements/element.rb
revo-webrat-0.7.0 lib/webrat/core/elements/element.rb
revo-webrat-0.7.1.pre lib/webrat/core/elements/element.rb
webrat-0.7.0 lib/webrat/core/elements/element.rb
honkster-webrat-0.6.0.10 lib/webrat/core/elements/element.rb