Class: Hussh::Channel
- Inherits:
-
Object
- Object
- Hussh::Channel
- Defined in:
- lib/hussh/channel.rb
Instance Attribute Summary collapse
-
#command ⇒ Object
readonly
Returns the value of attribute command.
-
#exec_block ⇒ Object
readonly
Returns the value of attribute exec_block.
-
#on_data_block ⇒ Object
readonly
Returns the value of attribute on_data_block.
-
#on_extended_data_block ⇒ Object
readonly
Returns the value of attribute on_extended_data_block.
-
#request_pty_block ⇒ Object
readonly
Returns the value of attribute request_pty_block.
Instance Method Summary collapse
- #exec(command, &block) ⇒ Object
-
#initialize(session) ⇒ Channel
constructor
A new instance of Channel.
- #on_data(&block) ⇒ Object
- #on_extended_data(&block) ⇒ Object
- #real_channel ⇒ Object
- #request_pty(&block) ⇒ Object
- #requested_pty? ⇒ Boolean
- #response_data ⇒ Object
Constructor Details
#initialize(session) ⇒ Channel
Returns a new instance of Channel.
3 4 5 6 |
# File 'lib/hussh/channel.rb', line 3 def initialize(session) @session = session @request_pty = false end |
Instance Attribute Details
#command ⇒ Object (readonly)
Returns the value of attribute command.
16 17 18 |
# File 'lib/hussh/channel.rb', line 16 def command @command end |
#exec_block ⇒ Object (readonly)
Returns the value of attribute exec_block.
17 18 19 |
# File 'lib/hussh/channel.rb', line 17 def exec_block @exec_block end |
#on_data_block ⇒ Object (readonly)
Returns the value of attribute on_data_block.
23 24 25 |
# File 'lib/hussh/channel.rb', line 23 def on_data_block @on_data_block end |
#on_extended_data_block ⇒ Object (readonly)
Returns the value of attribute on_extended_data_block.
28 29 30 |
# File 'lib/hussh/channel.rb', line 28 def on_extended_data_block @on_extended_data_block end |
#request_pty_block ⇒ Object (readonly)
Returns the value of attribute request_pty_block.
33 34 35 |
# File 'lib/hussh/channel.rb', line 33 def request_pty_block @request_pty_block end |
Instance Method Details
#exec(command, &block) ⇒ Object
18 19 20 21 |
# File 'lib/hussh/channel.rb', line 18 def exec(command, &block) @command = command @exec_block = block end |
#on_data(&block) ⇒ Object
24 25 26 |
# File 'lib/hussh/channel.rb', line 24 def on_data(&block) @on_data_block = block end |
#on_extended_data(&block) ⇒ Object
29 30 31 |
# File 'lib/hussh/channel.rb', line 29 def on_extended_data(&block) @on_extended_data_block = block end |
#real_channel ⇒ Object
8 9 10 |
# File 'lib/hussh/channel.rb', line 8 def real_channel @real_channel ||= @session.real_session.open_channel end |
#request_pty(&block) ⇒ Object
34 35 36 37 |
# File 'lib/hussh/channel.rb', line 34 def request_pty(&block) @request_pty = true @request_pty_block = block end |
#requested_pty? ⇒ Boolean
39 40 41 |
# File 'lib/hussh/channel.rb', line 39 def requested_pty? @request_pty end |
#response_data ⇒ Object
12 13 14 |
# File 'lib/hussh/channel.rb', line 12 def response_data @data end |