Exception: Effigy::ElementNotFound

Inherits:
StandardError
  • Object
show all
Defined in:
lib/effigy/errors.rb

Overview

Raised when attempting to select an element that isn’t on the source template.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(selector) ⇒ ElementNotFound

Returns a new instance of ElementNotFound.

Parameters:

  • the (String)

    selector that didn’t match any elements



9
10
11
# File 'lib/effigy/errors.rb', line 9

def initialize(selector)
  @selector = selector
end

Instance Attribute Details

#selectorObject

String

The selector that didn’t match any elements



6
7
8
# File 'lib/effigy/errors.rb', line 6

def selector
  @selector
end

Instance Method Details

#messageString

Returns a description of the failed search.

Returns:

  • (String)

    a description of the failed search



14
15
16
# File 'lib/effigy/errors.rb', line 14

def message
  "No element matched the given selector: #{selector.inspect}"
end