NameError#missing_name? can jsut use NameError#name if the arg is a Symbol
NameError#name returns a missing name as a symbol, so if the given name is a symbol, it doesn't have to use #missing_name to get the last constant name in the error message.
This commit is contained in:
parent
b9ba90d59e
commit
ebe73abea0
@ -23,8 +23,7 @@ def missing_name
|
||||
# # => true
|
||||
def missing_name?(name)
|
||||
if name.is_a? Symbol
|
||||
last_name = (missing_name || '').split('::').last
|
||||
last_name == name.to_s
|
||||
self.name == name
|
||||
else
|
||||
missing_name == name.to_s
|
||||
end
|
||||
|
Loading…
Reference in New Issue
Block a user