Exception: Taxonomite::InvalidParent
- Inherits:
-
RuntimeError
- Object
- RuntimeError
- Taxonomite::InvalidParent
- Extended by:
- CreateClassMethod
- Defined in:
- lib/taxonomite/exceptions.rb
Instance Method Summary collapse
-
#initialize(msg = "Invalid attempt to add Taxonomite::Node.", parent = nil, child = nil) ⇒ InvalidParent
constructor
A new instance of InvalidParent.
Methods included from CreateClassMethod
Constructor Details
#initialize(msg = "Invalid attempt to add Taxonomite::Node.", parent = nil, child = nil) ⇒ InvalidParent
Returns a new instance of InvalidParent.
25 26 27 28 29 30 31 32 |
# File 'lib/taxonomite/exceptions.rb', line 25 def initialize(msg = "Invalid attempt to add Taxonomite::Node.", parent = nil, child = nil) unless (parent.nil? && child.nil?) msg = "Cannot add " + ( child.nil? ? "nil child" : "#{child.name} (#{child.entity_type})" ) + " as child of #{parent.name} (#{parent.entity_type})" unless parent.nil? end super(msg) end |