Exception: Locabulary::Exceptions::MissingHierarchicalParentError
- Inherits:
-
RuntimeError
- Object
- RuntimeError
- RuntimeError
- Locabulary::Exceptions::MissingHierarchicalParentError
- Defined in:
- lib/locabulary/exceptions.rb
Overview
There is a problem with the hierarchy; A child is being defined without a defined parent.
Instance Attribute Summary collapse
-
#error ⇒ Object
readonly
Returns the value of attribute error.
-
#item ⇒ Object
readonly
Returns the value of attribute item.
-
#predicate_name ⇒ Object
readonly
Returns the value of attribute predicate_name.
Instance Method Summary collapse
-
#initialize(predicate_name, error, item = nil) ⇒ MissingHierarchicalParentError
constructor
A new instance of MissingHierarchicalParentError.
Constructor Details
#initialize(predicate_name, error, item = nil) ⇒ MissingHierarchicalParentError
Returns a new instance of MissingHierarchicalParentError.
21 22 23 24 25 26 27 28 29 |
# File 'lib/locabulary/exceptions.rb', line 21 def initialize(predicate_name, error, item = nil) @predicate_name = predicate_name @error = error @item = item = ["Expected #{predicate_name.inspect} to have a welformed tree."] << "With item #{item.inspect}." if item << "Error: #{error}" super(.join(" ")) end |
Instance Attribute Details
#error ⇒ Object (readonly)
Returns the value of attribute error.
20 21 22 |
# File 'lib/locabulary/exceptions.rb', line 20 def error @error end |
#item ⇒ Object (readonly)
Returns the value of attribute item.
20 21 22 |
# File 'lib/locabulary/exceptions.rb', line 20 def item @item end |
#predicate_name ⇒ Object (readonly)
Returns the value of attribute predicate_name.
20 21 22 |
# File 'lib/locabulary/exceptions.rb', line 20 def predicate_name @predicate_name end |