Class: Deface::Matchers::Element

Inherits:
Object
  • Object
show all
Defined in:
lib/deface/matchers/element.rb

Instance Method Summary collapse

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