diff options
author | Yuki Nishijima <yk.nishijima@gmail.com> | 2019-12-13 21:39:58 -0500 |
---|---|---|
committer | Yuki Nishijima <yk.nishijima@gmail.com> | 2019-12-13 21:40:52 -0500 |
commit | e2708068ad65f7f9986adf4fb3a4fa660f430a5a (patch) | |
tree | d20172ab8979e9bd741a43b33caac600a6b2cf44 /lib/did_you_mean | |
parent | f3240eb67dc4c807f6489a8a5ccb6eeec239efe5 (diff) | |
download | ruby-e2708068ad65f7f9986adf4fb3a4fa660f430a5a.tar.gz |
Drop delegate dependency
Original comment:
https://github.com/ruby/did_you_mean/commit/2f26c9ee770f28da0942c42cbc9e5800535b75e1
Diffstat (limited to 'lib/did_you_mean')
-rw-r--r-- | lib/did_you_mean/spell_checkers/name_error_checkers/class_name_checker.rb | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/lib/did_you_mean/spell_checkers/name_error_checkers/class_name_checker.rb b/lib/did_you_mean/spell_checkers/name_error_checkers/class_name_checker.rb index 3bd048b27c..924265b929 100644 --- a/lib/did_you_mean/spell_checkers/name_error_checkers/class_name_checker.rb +++ b/lib/did_you_mean/spell_checkers/name_error_checkers/class_name_checker.rb @@ -1,6 +1,5 @@ # frozen-string-literal: true -require 'delegate' require_relative "../../spell_checker" module DidYouMean @@ -32,16 +31,16 @@ module DidYouMean end.uniq end - class ClassName < SimpleDelegator + class ClassName < String attr :namespace def initialize(name, namespace = '') - super(name) + super(name.to_s) @namespace = namespace end def full_name - self.class.new("#{namespace}#{__getobj__}") + self.class.new("#{namespace}#{self}") end end |