Class: LocoBot::CLI::Command::Report

Inherits:
Base
  • Object
show all
Defined in:
lib/loco_bot/cli/command/report.rb

Overview

Upon execution, outputs the robot position to STDOUT.

Instance Attribute Summary

Attributes inherited from Base

#robot, #table

Instance Method Summary collapse

Methods inherited from Base

#initialize, label

Constructor Details

This class inherits a constructor from LocoBot::CLI::Command::Base

Instance Method Details

#executevoid

This method returns an undefined value.

Executes the command.


8
9
10
11
12
# File 'lib/loco_bot/cli/command/report.rb', line 8

def execute
  report_hash = robot.report

  puts report_string(report_hash) unless report_hash.empty?
end