class Prickle::Capybara::XPath::Expression

Constants

CONTAINS
SEPARATOR
TEXT_IDENTIFIER

Public Class Methods

new(identifier, value) click to toggle source
# File lib/prickle/capybara/xpath/expression.rb, line 10
def initialize identifier, value
  @identifier = identifier
  @value = value
end

Public Instance Methods

to_s() click to toggle source
# 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

Private Instance Methods

attribute() click to toggle source
# File lib/prickle/capybara/xpath/expression.rb, line 29
def attribute
  return identifier if identifier.eql? TEXT_IDENTIFIER
  "@#{identifier}"
end
find_exact_match?() click to toggle source
# File lib/prickle/capybara/xpath/expression.rb, line 21
def find_exact_match?
  !identifier.include? CONTAINS
end
identifier() click to toggle source
# File lib/prickle/capybara/xpath/expression.rb, line 25
def identifier
  @identifier.to_s
end