Class: LocoBot::CLI::Command::Base
- Inherits:
-
Object
- Object
- LocoBot::CLI::Command::Base
- Defined in:
- lib/loco_bot/cli/command/base.rb
Overview
Parent class for Command classes.
Instance Attribute Summary collapse
-
#robot ⇒ Robot
readonly
The Robot.
-
#table ⇒ Table
readonly
The Table.
Class Method Summary collapse
-
.label ⇒ String
Returns the Command’s label.
Instance Method Summary collapse
-
#initialize(robot, table) ⇒ Base
constructor
A new instance of Base.
Constructor Details
#initialize(robot, table) ⇒ Base
Returns a new instance of Base.
14 15 16 17 |
# File 'lib/loco_bot/cli/command/base.rb', line 14 def initialize(robot, table) @robot = robot @table = table end |
Instance Attribute Details
#robot ⇒ Robot (readonly)
Returns the Robot.
8 9 10 |
# File 'lib/loco_bot/cli/command/base.rb', line 8 def robot @robot end |
#table ⇒ Table (readonly)
Returns the Table.
8 |
# File 'lib/loco_bot/cli/command/base.rb', line 8 attr_reader :robot |
Class Method Details
.label ⇒ String
Returns the Command’s label.
21 22 23 |
# File 'lib/loco_bot/cli/command/base.rb', line 21 def self.label name.split('::').last.upcase end |