Exception: Eeml::Exceptions::MissingNode
- Defined in:
- lib/eeml/exceptions.rb
Overview
A structured exception which holds info about what was missing and from where. Note: Some reasons we don’t just hold everything in an unstructured exception message:
-
some bits might be useful for dev but not for the public,
-
testing is simplified by having the missing node name recorded explicitly (rather than in a human-readable, changeable string).
Instance Attribute Summary collapse
-
#base_node_name ⇒ Object
Returns the value of attribute base_node_name.
-
#sought_description ⇒ Object
Returns the value of attribute sought_description.
-
#sought_xpath ⇒ Object
Returns the value of attribute sought_xpath.
Attributes inherited from BadEeml
Instance Method Summary collapse
-
#initialize(base_node_name, sought_description, sought_xpath = nil) ⇒ MissingNode
constructor
A new instance of MissingNode.
- #to_s ⇒ Object
Constructor Details
#initialize(base_node_name, sought_description, sought_xpath = nil) ⇒ MissingNode
36 37 38 39 40 |
# File 'lib/eeml/exceptions.rb', line 36 def initialize(base_node_name, sought_description, sought_xpath = nil) @base_node_name = base_node_name @sought_description = sought_description @sought_xpath = sought_xpath end |
Instance Attribute Details
#base_node_name ⇒ Object
Returns the value of attribute base_node_name.
34 35 36 |
# File 'lib/eeml/exceptions.rb', line 34 def base_node_name @base_node_name end |
#sought_description ⇒ Object
Returns the value of attribute sought_description.
34 35 36 |
# File 'lib/eeml/exceptions.rb', line 34 def sought_description @sought_description end |
#sought_xpath ⇒ Object
Returns the value of attribute sought_xpath.
34 35 36 |
# File 'lib/eeml/exceptions.rb', line 34 def sought_xpath @sought_xpath end |
Instance Method Details
#to_s ⇒ Object
42 43 44 45 |
# File 'lib/eeml/exceptions.rb', line 42 def to_s "Missing '#@sought_description' node from base node: '#@base_node_name'" + (@sought_xpath ? "with xpath: '#@sought_xpath'" : "") end |