Class: Anachronism::Channel

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(telopt, telnet) ⇒ Channel

Returns a new instance of Channel.



4
5
6
7
8
9
# File 'lib/anachronism/channel.rb', line 4

def initialize (telopt, telnet)
  telnet.bind(telopt, self)
  
  @telnet = telnet
  @telopt = telopt
end

Instance Attribute Details

#telnetObject (readonly)

Returns the value of attribute telnet.



2
3
4
# File 'lib/anachronism/channel.rb', line 2

def telnet
  @telnet
end

#teloptObject (readonly)

Returns the value of attribute telopt.



2
3
4
# File 'lib/anachronism/channel.rb', line 2

def telopt
  @telopt
end

Instance Method Details

#local_enabled?Boolean

Returns:

  • (Boolean)


33
34
35
# File 'lib/anachronism/channel.rb', line 33

def local_enabled?
  @telnet.local_enabled?(@telopt)
end

#on_blurObject



48
49
# File 'lib/anachronism/channel.rb', line 48

def on_blur
end

#on_focusObject

Callbacks



45
46
# File 'lib/anachronism/channel.rb', line 45

def on_focus
end

#on_local_toggle(active) ⇒ Object



54
55
# File 'lib/anachronism/channel.rb', line 54

def on_local_toggle (active)
end

#on_remote_toggle(active) ⇒ Object



57
58
# File 'lib/anachronism/channel.rb', line 57

def on_remote_toggle (active)
end

#on_text(text) ⇒ Object



51
52
# File 'lib/anachronism/channel.rb', line 51

def on_text (text)
end

#remote_enabled?Boolean

Returns:

  • (Boolean)


37
38
39
# File 'lib/anachronism/channel.rb', line 37

def remote_enabled?
  @telnet.remote_enabled?(@telopt)
end

#request_local_disableObject



28
29
30
# File 'lib/anachronism/channel.rb', line 28

def request_local_disable
  @telnet.request_local_disable(@telopt)
end

#request_local_enable(opts = {}) ⇒ Object



24
25
26
# File 'lib/anachronism/channel.rb', line 24

def request_local_enable (opts={})
  @telnet.request_local_enable(@telopt, opts)
end

#request_remote_disableObject



20
21
22
# File 'lib/anachronism/channel.rb', line 20

def request_remote_disable
  @telnet.request_remote_disable(@telopt)
end

#request_remote_enable(opts = {}) ⇒ Object



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

def request_remote_enable (opts={})
  @telnet.request_remote_enable(@telopt, opts)
end

#send(data) ⇒ Object



11
12
13
# File 'lib/anachronism/channel.rb', line 11

def send (data)
  @telnet.send_subnegotiation(@telopt, data)
end