Class: Webrat::Element
Overview
:nodoc:
Instance Attribute Summary collapse
-
#element ⇒ Object
readonly
Returns the value of attribute element.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(session, element) ⇒ Element
constructor
A new instance of Element.
- #inspect ⇒ Object
- #path ⇒ Object
Constructor Details
#initialize(session, element) ⇒ Element
Returns a new instance of Element.
18 19 20 21 |
# File 'lib/webrat/core/elements/element.rb', line 18 def initialize(session, element) @session = session @element = element end |
Instance Attribute Details
#element ⇒ Object (readonly)
Returns the value of attribute element.
16 17 18 |
# File 'lib/webrat/core/elements/element.rb', line 16 def element @element end |
Class Method Details
.load(session, element) ⇒ Object
11 12 13 14 |
# File 'lib/webrat/core/elements/element.rb', line 11 def self.load(session, element) return nil if element.nil? session.elements[Webrat::XML.xpath_to(element)] ||= self.new(session, element) end |
.load_all(session, dom) ⇒ Object
5 6 7 8 9 |
# File 'lib/webrat/core/elements/element.rb', line 5 def self.load_all(session, dom) Webrat::XML.xpath_search(dom, xpath_search).map do |element| load(session, element) end end |