Class: Hussh::Channel

Inherits:
Object
  • Object
show all
Defined in:
lib/hussh/channel.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#commandObject (readonly)

Returns the value of attribute command.



16
17
18
# File 'lib/hussh/channel.rb', line 16

def command
  @command
end

#exec_blockObject (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_blockObject (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_blockObject (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_blockObject (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_channelObject



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

Returns:

  • (Boolean)


39
40
41
# File 'lib/hussh/channel.rb', line 39

def requested_pty?
  @request_pty
end

#response_dataObject



12
13
14
# File 'lib/hussh/channel.rb', line 12

def response_data
  @data
end