Exception: Locabulary::Exceptions::MissingHierarchicalParentError

Inherits:
RuntimeError
  • Object
show all
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

Instance Method Summary collapse

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
  message = ["Expected #{predicate_name.inspect} to have a welformed tree."]
  message << "With item #{item.inspect}." if item
  message << "Error: #{error}"
  super(message.join(" "))
end

Instance Attribute Details

#errorObject (readonly)

Returns the value of attribute error.



20
21
22
# File 'lib/locabulary/exceptions.rb', line 20

def error
  @error
end

#itemObject (readonly)

Returns the value of attribute item.



20
21
22
# File 'lib/locabulary/exceptions.rb', line 20

def item
  @item
end

#predicate_nameObject (readonly)

Returns the value of attribute predicate_name.



20
21
22
# File 'lib/locabulary/exceptions.rb', line 20

def predicate_name
  @predicate_name
end