lib/winsize.rb in winsize-1.0.0 vs lib/winsize.rb in winsize-1.0.1
- old
+ new
@@ -7,9 +7,13 @@
def initialize(rows, columns, horizontal_pixels = 0, vertical_pixels = 0)
@rows, @columns, @horizontal_pixels, @vertical_pixels = rows, columns, horizontal_pixels, vertical_pixels
end
+ def [](index)
+ [rows, columns][index]
+ end
+
def to_ioctl
[rows, columns, horizontal_pixels, vertical_pixels].pack("SSSS")
end
end