Exception: Rapid::NotMatchingTemplateError
- Inherits:
-
TemplateError
- Object
- Exception
- Exception
- TemplateError
- Rapid::NotMatchingTemplateError
- Defined in:
- lib/rapid/error.rb,
lib/rapid/error.rb
Instance Attribute Summary collapse
-
#content ⇒ Object
readonly
Returns the value of attribute content.
-
#expected_content ⇒ Object
readonly
Returns the value of attribute expected_content.
-
#previous_content ⇒ Object
readonly
Returns the value of attribute previous_content.
-
#result ⇒ Object
readonly
Returns the value of attribute result.
Instance Method Summary collapse
-
#initialize(result, expected_content, content, options = {}) ⇒ NotMatchingTemplateError
constructor
A new instance of NotMatchingTemplateError.
- #message ⇒ Object
Constructor Details
#initialize(result, expected_content, content, options = {}) ⇒ NotMatchingTemplateError
Returns a new instance of NotMatchingTemplateError.
52 53 54 55 |
# File 'lib/rapid/error.rb', line 52 def initialize result, expected_content, content, = {} @result, @expected_content, @content = result, expected_content, content @previous_content = [:previous] end |
Instance Attribute Details
#content ⇒ Object (readonly)
Returns the value of attribute content.
50 51 52 |
# File 'lib/rapid/error.rb', line 50 def content @content end |
#expected_content ⇒ Object (readonly)
Returns the value of attribute expected_content.
50 51 52 |
# File 'lib/rapid/error.rb', line 50 def expected_content @expected_content end |
#previous_content ⇒ Object (readonly)
Returns the value of attribute previous_content.
50 51 52 |
# File 'lib/rapid/error.rb', line 50 def previous_content @previous_content end |
#result ⇒ Object (readonly)
Returns the value of attribute result.
50 51 52 |
# File 'lib/rapid/error.rb', line 50 def result @result end |
Instance Method Details
#message ⇒ Object
57 58 59 60 61 62 63 64 65 66 |
# File 'lib/rapid/error.rb', line 57 def = [ "after: #{previous_content.nil? ? "nil" : previous_content[0..100].inspect}", "expected: #{expected_content[0..100].inspect}", "received: #{content[0..100].inspect}", "current: #{result.inspect}" ] .join("\n") end |