Class: Prickle::Capybara::XPath::Element
- Inherits:
-
Object
- Object
- Prickle::Capybara::XPath::Element
- Defined in:
- lib/prickle/capybara/xpath.rb
Instance Method Summary collapse
- #identifier ⇒ Object
-
#initialize(type, identifier) ⇒ Element
constructor
A new instance of Element.
- #to_s ⇒ Object
Constructor Details
#initialize(type, identifier) ⇒ Element
Returns a new instance of Element.
14 15 16 17 |
# File 'lib/prickle/capybara/xpath.rb', line 14 def initialize type, identifier @type = type @identifier = identifier end |
Instance Method Details
#identifier ⇒ Object
23 24 25 26 27 |
# File 'lib/prickle/capybara/xpath.rb', line 23 def identifier return @identifier.each_pair.inject([]) do | xpath, (identifier, value) | xpath << XPath::Expression.new(identifier, value).to_s end.join Expression::SEPARATOR end |
#to_s ⇒ Object
19 20 21 |
# File 'lib/prickle/capybara/xpath.rb', line 19 def to_s "//#{@type}[#{identifier}]" end |