class Rigit::Commands::Info::InfoHandler

Internal class to handle the display of metadata about a rig for the {CommandLine} class.

Attributes

args[R]
rig_name[R]

Public Class Methods

new(args) click to toggle source
# File lib/rigit/commands/info.rb, line 18
def initialize(args)
  @args = args
  @rig_name = args['RIG']
end

Public Instance Methods

execute() click to toggle source
# File lib/rigit/commands/info.rb, line 23
def execute
  verify_presence
  info
end

Private Instance Methods

info() click to toggle source
# File lib/rigit/commands/info.rb, line 30
def info
  rig.info.each do |key, value|
    say "!txtgrn!#{key}!txtrst!:"
    say word_wrap "  #{value}"
    say ""
  end
end
rig() click to toggle source
# File lib/rigit/commands/info.rb, line 38
def rig
  @rig ||= Rigit::Rig.new rig_name
end
verify_presence() click to toggle source
# File lib/rigit/commands/info.rb, line 42
def verify_presence
  if !rig.exist?
    say "Cannot find rig !txtgrn!#{rig_name}"
    raise Rigit::Exit
  end
end