Class: Gaptool::InteractionHandler
- Inherits:
-
Object
- Object
- Gaptool::InteractionHandler
- Defined in:
- lib/gaptool_client/host.rb
Instance Attribute Summary collapse
-
#host ⇒ Object
readonly
Returns the value of attribute host.
Instance Method Summary collapse
-
#initialize(host) ⇒ InteractionHandler
constructor
A new instance of InteractionHandler.
- #on_data(_command, stream_name, data, _channel) ⇒ Object
Constructor Details
#initialize(host) ⇒ InteractionHandler
Returns a new instance of InteractionHandler.
9 10 11 |
# File 'lib/gaptool_client/host.rb', line 9 def initialize(host) @host = host end |
Instance Attribute Details
#host ⇒ Object (readonly)
Returns the value of attribute host.
8 9 10 |
# File 'lib/gaptool_client/host.rb', line 8 def host @host end |
Instance Method Details
#on_data(_command, stream_name, data, _channel) ⇒ Object
13 14 15 16 17 18 19 20 |
# File 'lib/gaptool_client/host.rb', line 13 def on_data(_command, stream_name, data, _channel) case stream_name when :stdout puts "#{Rainbow("#{@host}").yellow}> #{data}" when :stderr STDERR.puts "#{Rainbow("#{@host}").red}> #{data}" end end |