Class: Anachronism::Channel
- Inherits:
-
Object
- Object
- Anachronism::Channel
- Defined in:
- lib/anachronism/channel.rb
Instance Attribute Summary collapse
-
#telnet ⇒ Object
readonly
Returns the value of attribute telnet.
-
#telopt ⇒ Object
readonly
Returns the value of attribute telopt.
Instance Method Summary collapse
-
#initialize(telopt, telnet) ⇒ Channel
constructor
A new instance of Channel.
- #local_enabled? ⇒ Boolean
- #on_blur ⇒ Object
-
#on_focus ⇒ Object
Callbacks.
- #on_local_toggle(active) ⇒ Object
- #on_remote_toggle(active) ⇒ Object
- #on_text(text) ⇒ Object
- #remote_enabled? ⇒ Boolean
- #request_local_disable ⇒ Object
- #request_local_enable(opts = {}) ⇒ Object
- #request_remote_disable ⇒ Object
- #request_remote_enable(opts = {}) ⇒ Object
- #send(data) ⇒ Object
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
#telnet ⇒ Object (readonly)
Returns the value of attribute telnet.
2 3 4 |
# File 'lib/anachronism/channel.rb', line 2 def telnet @telnet end |
#telopt ⇒ Object (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
33 34 35 |
# File 'lib/anachronism/channel.rb', line 33 def local_enabled? @telnet.local_enabled?(@telopt) end |
#on_blur ⇒ Object
48 49 |
# File 'lib/anachronism/channel.rb', line 48 def on_blur end |
#on_focus ⇒ Object
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
37 38 39 |
# File 'lib/anachronism/channel.rb', line 37 def remote_enabled? @telnet.remote_enabled?(@telopt) end |
#request_local_disable ⇒ Object
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_disable ⇒ Object
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 |