Class: Cursor
- Inherits:
-
Object
- Object
- Cursor
- Defined in:
- lib/asciinema/cursor.rb
Instance Attribute Summary collapse
-
#visible ⇒ Object
readonly
Returns the value of attribute visible.
-
#x ⇒ Object
readonly
Returns the value of attribute x.
-
#y ⇒ Object
readonly
Returns the value of attribute y.
Instance Method Summary collapse
- #diff(other) ⇒ Object
-
#initialize(x, y, visible) ⇒ Cursor
constructor
A new instance of Cursor.
Constructor Details
#initialize(x, y, visible) ⇒ Cursor
Returns a new instance of Cursor.
5 6 7 |
# File 'lib/asciinema/cursor.rb', line 5 def initialize(x, y, visible) @x, @y, @visible = x, y, visible end |
Instance Attribute Details
#visible ⇒ Object (readonly)
Returns the value of attribute visible.
3 4 5 |
# File 'lib/asciinema/cursor.rb', line 3 def visible @visible end |
#x ⇒ Object (readonly)
Returns the value of attribute x.
3 4 5 |
# File 'lib/asciinema/cursor.rb', line 3 def x @x end |
#y ⇒ Object (readonly)
Returns the value of attribute y.
3 4 5 |
# File 'lib/asciinema/cursor.rb', line 3 def y @y end |
Instance Method Details
#diff(other) ⇒ Object
9 10 11 12 13 14 15 16 |
# File 'lib/asciinema/cursor.rb', line 9 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 |