Sha256: 05df26a550c4746197720d8d9e7984f82221ef557c9f3b89cd1e2dd165aab320

Contents?: true

Size: 662 Bytes

Versions: 39

Compression:

Stored size: 662 Bytes

Contents

module Webrat
  
  class Element # :nodoc:
    
    def self.load_all(session, dom)
      Webrat::XML.xpath_search(dom, xpath_search).map do |element| 
        load(session, element)
      end
    end
    
    def self.load(session, element)
      return nil if element.nil?
      session.elements[Webrat::XML.xpath_to(element)] ||= self.new(session, element)
    end
    
    attr_reader :element
    
    def initialize(session, element)
      @session  = session
      @element  = element
    end
    
    def path
      Webrat::XML.xpath_to(@element)
    end
    
    def inspect
      "#<#{self.class} @element=#{element.inspect}>"
    end
    
  end
  
end

Version data entries

39 entries across 39 versions & 13 rubygems

Version Path
adva-0.2.4 test/webrat/lib/webrat/core/elements/element.rb
adva-0.2.3 test/webrat/lib/webrat/core/elements/element.rb
adva-0.2.2 test/webrat/lib/webrat/core/elements/element.rb
adva-0.2.1 test/webrat/lib/webrat/core/elements/element.rb
adva-0.2.0 test/webrat/lib/webrat/core/elements/element.rb
adva-0.1.4 test/webrat/lib/webrat/core/elements/element.rb
adva-0.1.3 test/webrat/lib/webrat/core/elements/element.rb
adva-0.1.2 test/webrat/lib/webrat/core/elements/element.rb
adva-0.1.1 test/webrat/lib/webrat/core/elements/element.rb
adva-0.1.0 test/webrat/lib/webrat/core/elements/element.rb
adva-0.0.1 test/webrat/lib/webrat/core/elements/element.rb
aslakhellesoy-webrat-0.3.2.1 lib/webrat/core/elements/element.rb
aslakhellesoy-webrat-0.3.2.2 lib/webrat/core/elements/element.rb
auxesis-webrat-0.4.1 lib/webrat/core/elements/element.rb
brynary-webrat-0.3.2.2 lib/webrat/core/elements/element.rb
brynary-webrat-0.4.0 lib/webrat/core/elements/element.rb
diabolo-webrat-0.4.2 lib/webrat/core/elements/element.rb
flazz-webrat-0.3.2.1 lib/webrat/core/elements/element.rb
hectoregm-webrat-0.4.2 lib/webrat/core/elements/element.rb
jferris-webrat-0.4.3.0.1238640835 lib/webrat/core/elements/element.rb