class Samovar::Output::Header
Represents a header row in usage output.
Headers display command names and their descriptions.
Attributes
The command name.
@attribute [String]
The command class.
@attribute [Command]
Public Class Methods
Source
# File vendor/bundle/ruby/3.4.0/gems/samovar-2.4.1/lib/samovar/output/header.rb, line 16 def initialize(name, object) @name = name @object = object end
Initialize a new header.
@parameter name [String] The command name. @parameter object [Command] The command class.
Public Instance Methods
Source
# File vendor/bundle/ruby/3.4.0/gems/samovar-2.4.1/lib/samovar/output/header.rb, line 35 def align(columns) @object.command_line(@name) end
Generate an aligned header string.
@parameter columns [Columns] The columns for alignment (unused for headers). @returns [String] The command line usage string.