Module: Moc::Protocol::Type
Instance Method Summary collapse
Instance Method Details
#read(io) ⇒ Object
16 17 18 |
# File 'lib/moc/protocol.rb', line 16 def read (io) raise 'no read has been implemented' end |
#unpack(text, eat = false) ⇒ Object
20 21 22 23 24 25 26 |
# File 'lib/moc/protocol.rb', line 20 def unpack (text, eat = false) io = StringIO.new(text) read(io).tap { text[0, io.tell] = '' if eat } end |