Skip to content

Commit 255a95d

Browse files
authored
Standardize BlankLine markup (#1520)
Continuing the work from #1389. This PR standardizes the `BlankLine` element to a consistent style and starts inheriting from `Element`.
1 parent 8ea57fb commit 255a95d

File tree

1 file changed

+25
-23
lines changed

1 file changed

+25
-23
lines changed

lib/rdoc/markup/blank_line.rb

Lines changed: 25 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,29 @@
11
# frozen_string_literal: true
2-
##
3-
# An empty line. This class is a singleton.
42

5-
class RDoc::Markup::BlankLine
6-
7-
@instance = new
8-
9-
##
10-
# RDoc::Markup::BlankLine is a singleton
11-
12-
def self.new
13-
@instance
3+
module RDoc
4+
class Markup
5+
# An empty line
6+
class BlankLine < Element
7+
@instance = new
8+
9+
# RDoc::Markup::BlankLine is a singleton
10+
#: () -> BlankLine
11+
def self.new
12+
@instance
13+
end
14+
15+
# Calls #accept_blank_line on +visitor+
16+
# @override
17+
#: (untyped) -> void
18+
def accept(visitor)
19+
visitor.accept_blank_line(self)
20+
end
21+
22+
# @override
23+
#: (PP) -> void
24+
def pretty_print(q) # :nodoc:
25+
q.text("blankline")
26+
end
27+
end
1428
end
15-
16-
##
17-
# Calls #accept_blank_line on +visitor+
18-
19-
def accept(visitor)
20-
visitor.accept_blank_line self
21-
end
22-
23-
def pretty_print(q) # :nodoc:
24-
q.text 'blankline'
25-
end
26-
2729
end

0 commit comments

Comments
 (0)