Class: Prickle::Capybara::XPath::Expression

Inherits:
Object
  • Object
show all
Defined in:
lib/prickle/capybara/xpath/expression.rb

Direct Known Subclasses

ContainsValue, MatchesValue

Constant Summary collapse

CONTAINS =
".like"
TEXT_IDENTIFIER =
"text()"
SEPARATOR =
" and "

Instance Method Summary collapse

Constructor Details

#initialize(identifier, value) ⇒ Expression

Returns a new instance of Expression.



10
11
12
13
# File 'lib/prickle/capybara/xpath/expression.rb', line 10

def initialize identifier, value
  @identifier = identifier
  @value = value
end

Instance Method Details

#to_sObject



15
16
17
# File 'lib/prickle/capybara/xpath/expression.rb', line 15

def to_s
  find_exact_match? ? MatchesValue.new(@identifier, @value).to_s : ContainsValue.new(@identifier, @value).to_s
end