lib/osc-ruby/packet.rb in aberant-osc-ruby-0.1.5 vs lib/osc-ruby/packet.rb in aberant-osc-ruby-0.1.6
- old
+ new
@@ -1,13 +1,27 @@
module OSC
class Packet
class PO
- def initialize(str) @str, @index = str, 0 end
- def rem() @str.length - @index end
- def eof? () rem <= 0 end
- def skip(n) @index += n end
- def skip_padding() skip((4 - (@index % 4)) % 4) end
+ def initialize(str)
+ @str, @index = str, 0
+ end
+
+ def rem()
+ @str.length - @index
+ end
+
+ def eof? ()
+ rem <= 0
+ end
+
+ def skip(n)
+ @index += n
+ end
+
+ def skip_padding()
+ skip((4 - (@index % 4)) % 4)
+ end
def getn(n)
raise EOFError if rem < n
s = @str[@index, n]
skip(n)
\ No newline at end of file