class OTerm::Telnet

Constants

BIN

features

DO
DONT
ECHO
IAC
SGA
WILL

verbs

WONT

Public Class Methods

msg(verb, feature) click to toggle source
# File lib/oterm/telnet.rb, line 18
def self.msg(verb, feature)
  [IAC, verb, feature].join('')
end
parse(line) click to toggle source
# File lib/oterm/telnet.rb, line 22
def self.parse(line)
  msgs = []
  v = nil
  line.each_char do |c|
    if nil == v
      v = c unless IAC == c
    else
      msgs << [v, c]
      v = nil
    end
  end
  msgs
end