Class: Del::Tron
- Inherits:
-
Object
- Object
- Del::Tron
- Defined in:
- lib/del/tron.rb
Instance Attribute Summary collapse
-
#configuration ⇒ Object
readonly
Returns the value of attribute configuration.
-
#robot ⇒ Object
readonly
Returns the value of attribute robot.
Instance Method Summary collapse
- #execute(request) ⇒ Object
-
#initialize(robot, configuration) ⇒ Tron
constructor
A new instance of Tron.
Constructor Details
#initialize(robot, configuration) ⇒ Tron
Returns a new instance of Tron.
7 8 9 10 |
# File 'lib/del/tron.rb', line 7 def initialize(robot, configuration) @robot = robot @configuration = configuration end |
Instance Attribute Details
#configuration ⇒ Object (readonly)
Returns the value of attribute configuration.
5 6 7 |
# File 'lib/del/tron.rb', line 5 def configuration @configuration end |
#robot ⇒ Object (readonly)
Returns the value of attribute robot.
5 6 7 |
# File 'lib/del/tron.rb', line 5 def robot @robot end |
Instance Method Details
#execute(request) ⇒ Object
12 13 14 15 16 |
# File 'lib/del/tron.rb', line 12 def execute(request) command_for(request)&.call(request) || 'Unknown' rescue StandardError => error error. end |