Sha256: 308accb854d8a6653821c49f616da6feae293d6a43b7e5f2580258b4760a4555
Contents?: true
Size: 695 Bytes
Versions: 32
Compression:
Stored size: 695 Bytes
Contents
module HammerCLI module Help class Section < AbstractItem attr_reader :label def initialize(label, definition = nil, options = {}) super(options) @label = label @id ||= label build_definition(definition) end def build_string out = StringIO.new out.puts heading out.puts indent(@definition.build_string) out.string end protected def build_definition(content) @definition = content || Definition.new end private def heading label = "#{@label}:" label = HighLine.color(label, :bold) if @richtext label end end end end
Version data entries
32 entries across 32 versions & 1 rubygems