Class: Deface::Matchers::Element
- Inherits:
-
Object
- Object
- Deface::Matchers::Element
- Defined in:
- lib/deface/matchers/element.rb
Instance Method Summary collapse
-
#initialize(selector) ⇒ Element
constructor
A new instance of Element.
- #matches(document, log = true) ⇒ Object
Constructor Details
#initialize(selector) ⇒ Element
Returns a new instance of Element.
4 5 6 |
# File 'lib/deface/matchers/element.rb', line 4 def initialize(selector) @selector = selector end |
Instance Method Details
#matches(document, log = true) ⇒ Object
8 9 10 |
# File 'lib/deface/matchers/element.rb', line 8 def matches(document, log=true) document.css(@selector).map { |match| [match] } end |