Class: Vedeu::Position
- Inherits:
-
Object
- Object
- Vedeu::Position
- Defined in:
- lib/vedeu/support/position.rb
Instance Method Summary collapse
- #initialize(y = 1, x = 1) ⇒ Position constructor
- #sequence ⇒ String private private
- #to_s(&block) ⇒ String
- #x ⇒ Fixnum private private
- #y ⇒ Fixnum private private
Constructor Details
#initialize(y = 1, x = 1) ⇒ Position
7 8 9 |
# File 'lib/vedeu/support/position.rb', line 7 def initialize(y = 1, x = 1) @y, @x = y, x end |
Instance Method Details
#sequence ⇒ String (private)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
27 28 29 |
# File 'lib/vedeu/support/position.rb', line 27 def sequence ["\e[", y, ';', x, 'H'].join end |
#to_s(&block) ⇒ String
13 14 15 16 17 18 19 20 21 |
# File 'lib/vedeu/support/position.rb', line 13 def to_s(&block) if block_given? [ sequence, yield, sequence ].join else sequence end end |
#x ⇒ Fixnum (private)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
39 40 41 |
# File 'lib/vedeu/support/position.rb', line 39 def x (@x == 0 || @x == nil) ? 1 : @x end |
#y ⇒ Fixnum (private)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
33 34 35 |
# File 'lib/vedeu/support/position.rb', line 33 def y (@y == 0 || @y == nil) ? 1 : @y end |