Class Scrubyt::SimpleExampleLookup
In: lib/scrubyt/utils/simple_example_lookup.rb
Parent: Object

Lookup of simple examples

There are two types of string examples in scRUBYt! right now: the simple example and the compound example.

This class is responsible for finding elements matched by simple examples. In the futre probably more sophisticated matching algorithms will be added (e.g. match the n-th which matches the text, or element that matches the text but also contains a specific attribute etc.)

Methods

Public Class methods

From the example text defined by the user, find the lowest possible node which contains the text ‘text’. The text can be also a mixed content text, e.g.

 <a>Bon <b>nuit</b>, monsieur!</a>

In this case, <a>’s text is considered to be "Bon nuit, monsieur"

[Validate]