Exception: Taxonomite::InvalidChild

Inherits:
RuntimeError
  • Object
show all
Extended by:
CreateClassMethod
Defined in:
lib/taxonomite/exceptions.rb

Instance Method Summary collapse

Methods included from CreateClassMethod

create

Constructor Details

#initialize(msg = "Invalid attempt to add Taxonomite::Node.", parent = nil, child = nil) ⇒ InvalidChild

Returns a new instance of InvalidChild.



14
15
16
17
18
19
# File 'lib/taxonomite/exceptions.rb', line 14

def initialize(msg = "Invalid attempt to add Taxonomite::Node.", 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?
  super(msg)
end