lib/command_mapper/command.rb in command_mapper-0.1.1 vs lib/command_mapper/command.rb in command_mapper-0.1.2
- old
+ new
@@ -179,10 +179,14 @@
# The command class did not call {command}.
#
# @api semipublic
#
def self.command_name
- @command_name || raise(NotImplementedError,"#{self} did not call command(...)")
+ @command_name || if superclass < Command
+ superclass.command_name
+ else
+ raise(NotImplementedError,"#{self} did not call command(...)")
+ end
end
#
# @param [#to_s] new_command_name
#