Permalink
Browse files

Update error to include Class#inspect when there is no Class#name

  • Loading branch information...
dkubb committed Nov 26, 2012
1 parent 0c4de21 commit 701ffd6a435df02ece22cfeb9dc44eb006ce13ed
Showing with 6 additions and 6 deletions.
  1. +6 −6 lib/abstract_type.rb
View
@@ -90,9 +90,9 @@ def abstract_singleton_method(*names)
# @api private
def create_abstract_singleton_method(name)
class_eval <<-RUBY, __FILE__, __LINE__ + 1
def self.#{name}(*) # def self.name(*)
raise NotImplementedError, "\#{name}.\#{__method__} is not implemented" # raise NotImplementedError, 'MyClass#name is not implemented'
end # end
def self.#{name}(*) # def self.name(*)
raise NotImplementedError, "\#{name || inspect}.\#{__method__} is not implemented" # raise NotImplementedError, 'MyClass#name is not implemented'
end # end
RUBY
end
@@ -106,9 +106,9 @@ def self.#{name}(*) # def
# @api private
def create_abstract_instance_method(name)
class_eval <<-RUBY, __FILE__, __LINE__ + 1
def #{name}(*) # def name(*)
raise NotImplementedError, "\#{self.class.name}#\#{__method__} is not implemented" # raise NotImplementedError, 'MyClass.name is not implemented'
end # end
def #{name}(*) # def name(*)
raise NotImplementedError, "\#{self.class.name || self.class.inspect}#\#{__method__} is not implemented" # raise NotImplementedError, 'MyClass.name is not implemented'
end # end
RUBY
end

0 comments on commit 701ffd6

Please sign in to comment.