instance method
Prism::Pack::Format#describe
describe
lib/prism/pack.rb
View on GitHub ↗
# File tmp/rubies/ruby-4.0.0/lib/prism/pack.rb, line 214
def describe
source_width = directives.map { |d| d.source.inspect.length }.max
directive_lines = directives.map do |directive|
if directive.type == SPACE
source = directive.source.inspect
else
source = directive.source
end
# @type var source_width: Integer
" #{source.ljust(source_width)} #{directive.describe}"
end
(["Directives:"] + directive_lines + ["Encoding:", " #{encoding}"]).join("\n")
end
Provide a human-readable description of the format.