Class: RBS::Annotate::Formatter
Relationships & Source Files | |
Inherits: | Object |
Defined in: | lib/rbs/annotate/formatter.rb |
Class Method Summary
- .each_part(doc, &block)
- .new ⇒ Formatter constructor
- .translate(doc)
Instance Attribute Summary
- #buffer readonly
- #empty? ⇒ Boolean readonly
Instance Method Summary
Constructor Details
.new ⇒ Formatter
# File 'lib/rbs/annotate/formatter.rb', line 8
def initialize() @buffer = +"" @pending_separator = nil end
Class Method Details
.each_part(doc, &block)
[ GitHub ]# File 'lib/rbs/annotate/formatter.rb', line 60
def self.each_part(doc, &block) if block if doc.file yield doc else doc.each do |d| each_part(d, &block) end end else enum_for :each_part, doc end end
.translate(doc)
[ GitHub ]# File 'lib/rbs/annotate/formatter.rb', line 74
def self.translate(doc) if doc.file formatter = RDoc::Markup::ToMarkdown.new doc.accept(formatter).strip.lines.map(&:rstrip).join("\n") end end
Instance Attribute Details
#buffer (readonly)
[ GitHub ]# File 'lib/rbs/annotate/formatter.rb', line 6
attr_reader :buffer
#empty? ⇒ Boolean
(readonly)
[ GitHub ]
# File 'lib/rbs/annotate/formatter.rb', line 44
def empty? buffer.empty? end