class YARP::Pack::Format
def describe
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
def initialize(directives, encoding)
def initialize(directives, encoding) @directives = directives @encoding = encoding end