Class: Vedeu::Output::Direct
- Inherits:
-
Object
- Object
- Vedeu::Output::Direct
- Defined in:
- lib/vedeu/output/direct.rb
Overview
Write a string directly to the terminal at defined coordinates.
Instance Attribute Summary collapse
- #value ⇒ String readonly protected
- #x ⇒ Fixnum readonly protected
- #y ⇒ Fixnum readonly protected
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(value:, x:, y:) ⇒ Vedeu::Output::Direct
constructor
Returns a new instance of Vedeu::Output::Direct.
- #output ⇒ String private
- #position ⇒ String private
- #write ⇒ String
Constructor Details
#initialize(value:, x:, y:) ⇒ Vedeu::Output::Direct
Returns a new instance of Vedeu::Output::Direct.
23 24 25 26 27 |
# File 'lib/vedeu/output/direct.rb', line 23 def initialize(value:, x:, y:) @value = value || '' @x = x || 1 @y = y || 1 end |
Instance Attribute Details
#value ⇒ String (readonly, protected)
40 41 42 |
# File 'lib/vedeu/output/direct.rb', line 40 def value @value end |
#x ⇒ Fixnum (readonly, protected)
44 45 46 |
# File 'lib/vedeu/output/direct.rb', line 44 def x @x end |
#y ⇒ Fixnum (readonly, protected)
48 49 50 |
# File 'lib/vedeu/output/direct.rb', line 48 def y @y end |
Class Method Details
.write(value:, x:, y:) ⇒ String
13 14 15 |
# File 'lib/vedeu/output/direct.rb', line 13 def self.write(value:, x:, y:) new(value: value, x: x, y: y).write end |