File tree Expand file tree Collapse file tree 1 file changed +8
-13
lines changed
lib/rdoc/code_object/context Expand file tree Collapse file tree 1 file changed +8
-13
lines changed Original file line number Diff line number Diff line change @@ -61,13 +61,10 @@ def == other
61
61
# Adds +comment+ to this section
62
62
63
63
def add_comment comment
64
- if comment . is_a? ( Array )
65
- comment . each do |c |
66
- @comments << extract_comment ( c )
67
- end
68
- else
69
- comment = extract_comment ( comment )
70
- @comments << comment unless comment . empty?
64
+ comments = Array ( comment )
65
+ comments . each do |c |
66
+ extracted_comment = extract_comment ( c )
67
+ @comments << extracted_comment unless extracted_comment . empty?
71
68
end
72
69
end
73
70
@@ -123,9 +120,7 @@ def hash # :nodoc:
123
120
# The files comments in this section come from
124
121
125
122
def in_files
126
- @comments . map do |comment |
127
- comment . file
128
- end
123
+ @comments . map ( &:file )
129
124
end
130
125
131
126
##
@@ -171,9 +166,9 @@ def plain_html
171
166
# Removes a comment from this section if it is from the same file as
172
167
# +comment+
173
168
174
- def remove_comment comment
175
- @comments . delete_if do |my_comment |
176
- my_comment . file == comment . file
169
+ def remove_comment target_comment
170
+ @comments . delete_if do |stored_comment |
171
+ stored_comment . file == target_comment . file
177
172
end
178
173
end
179
174
You can’t perform that action at this time.
0 commit comments