Exception: Nokogiri::XML::NotFound
- Inherits:
-
StandardError
- Object
- StandardError
- Nokogiri::XML::NotFound
- Defined in:
- lib/nokogiri_bang_finders.rb
Instance Attribute Summary collapse
-
#message ⇒ Object
readonly
Returns the value of attribute message.
Instance Method Summary collapse
-
#initialize(needle, haystack) ⇒ NotFound
constructor
A new instance of NotFound.
- #snippet(haystack) ⇒ Object
Constructor Details
#initialize(needle, haystack) ⇒ NotFound
22 23 24 |
# File 'lib/nokogiri_bang_finders.rb', line 22 def initialize(needle, haystack) = "#{needle} in \n#{snippet(haystack)}" end |
Instance Attribute Details
#message ⇒ Object (readonly)
Returns the value of attribute message.
21 22 23 |
# File 'lib/nokogiri_bang_finders.rb', line 21 def end |
Instance Method Details
#snippet(haystack) ⇒ Object
25 26 27 28 |
# File 'lib/nokogiri_bang_finders.rb', line 25 def snippet(haystack) snippet = haystack.to_s snippet.length > 200 ? "#{snippet[0...200]}..." : snippet end |