summaryrefslogtreecommitdiff
path: root/lib/rdoc/code_object.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/rdoc/code_object.rb')
-rw-r--r--lib/rdoc/code_object.rb14
1 files changed, 3 insertions, 11 deletions
diff --git a/lib/rdoc/code_object.rb b/lib/rdoc/code_object.rb
index 4620fa586d..aeb4b4762e 100644
--- a/lib/rdoc/code_object.rb
+++ b/lib/rdoc/code_object.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
##
# Base class for the RDoc code tree.
#
@@ -69,13 +70,6 @@ class RDoc::CodeObject
attr_reader :metadata
##
- # Offset in #file where this CodeObject was defined
- #--
- # TODO character or byte?
-
- attr_accessor :offset
-
- ##
# Sets the parent CodeObject
attr_writer :parent
@@ -149,9 +143,8 @@ class RDoc::CodeObject
else
# HACK correct fix is to have #initialize create @comment
# with the correct encoding
- if String === @comment and
- Object.const_defined? :Encoding and @comment.empty? then
- @comment.force_encoding comment.encoding
+ if String === @comment and @comment.empty? then
+ @comment = RDoc::Encoding.change_encoding @comment, comment.encoding
end
@comment
end
@@ -426,4 +419,3 @@ class RDoc::CodeObject
end
end
-