Class: YardToRbsInline::Converter::PrependLine

Inherits:
Object
  • Object
show all
Defined in:
lib/yard_to_rbs_inline/converter/text_with_mod.rb

Class Method Summary collapse

Class Method Details

.from_node_and_content(node, comment_content) ⇒ Object

: (Prism::Node, String) -> PrependLine



14
15
16
17
18
19
20
21
# File 'lib/yard_to_rbs_inline/converter/text_with_mod.rb', line 14

def self.from_node_and_content(node, comment_content)
  start_line = node.location.start_line
  start_column = node.location.start_column

  line = " " * start_column + comment_content

  PrependLine.new(line_num: start_line, content: line)
end