asciinema.org/app/models/cursor.rb
2013-09-10 21:29:17 +02:00

19 lines
367 B
Ruby

class Cursor
attr_reader :x, :y, :visible
def initialize(x, y, visible)
@x, @y, @visible = x, y, visible
end
def diff(other)
diff = {}
diff[:x] = x if other && x != other.x || other.nil?
diff[:y] = y if other && y != other.y || other.nil?
diff[:visible] = visible if other && visible != other.visible || other.nil?
diff
end
end