The result of parsing a pack template.
Methods
Attributes
[R] | directives | A list of the directives in the template. |
[R] | encoding | The encoding of the template. |
Class Public methods
Instance Public methods
describe() Link
Provide a human-readable description of the format.
# File ruby/lib/prism/pack.rb, line 209 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 " #{source.ljust(source_width)} #{directive.describe}" end (["Directives:"] + directive_lines + ["Encoding:", " #{encoding}"]).join("\n") end