Module: GraphQL::Language::Comment

Defined in:
lib/graphql/language/comment.rb

Class Method Summary collapse

Class Method Details



5
6
7
8
9
10
11
12
13
14
15
# File 'lib/graphql/language/comment.rb', line 5

def self.print(str, indent: '')
  lines = str.split("\n").map do |line|
    comment_str = "".dup
    comment_str << indent
    comment_str << "# "
    comment_str << line
    comment_str.rstrip
  end

  lines.join("\n") + "\n"
end