Skip to content

Commit 5acc46e

Browse files
committed
Fix comment location marshalling in ClassModule
Similar to other code objects' marshalling behaviour, `ClassModule#comment_location`'s content type would change before/after marshalling. But it should still be an array of pairs that respond to the same set of methods. This commit also adds documentation about the marshalling behaviour of `ClassModule#comment_location`.
1 parent 45d48cd commit 5acc46e

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

lib/rdoc/code_object/class_module.rb

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,12 @@ class RDoc::ClassModule < RDoc::Context
4040
# After unmarshalling:
4141
# - +comment+ is an RDoc::Markup::Document
4242
# - +location+ is a filename String
43+
#
44+
# These type changes are acceptable (for now) because:
45+
# - +comment+: Both String and Document respond to #empty?, and #parse
46+
# returns Document as-is (see RDoc::Text#parse)
47+
# - +location+: Only used by #parse to set Document#file, which accepts
48+
# both TopLevel (extracts relative_name) and String
4349

4450
attr_accessor :comment_location
4551

0 commit comments

Comments
 (0)