lib/vedeu/output/direct.rb in vedeu-0.6.20 vs lib/vedeu/output/direct.rb in vedeu-0.6.21

- old
+ new

@@ -4,13 +4,11 @@ # Write a string directly to the terminal at defined coordinates. # class Direct - # @param value [String] - # @param x [Fixnum] - # @param y [Fixnum] + # @param (see #initialize) # @return [String] def self.write(value:, x:, y:) new(value: value, x: x, y: y).write end @@ -26,10 +24,12 @@ @y = y || 1 end # @return [String] def write + Vedeu.log(type: :output, + message: 'Directly writing output to terminal.') Vedeu::Terminal.output(output) output end @@ -49,10 +49,10 @@ private # @return [String] def output - (Array(position) + Array(value)).join + @output ||= (Array(position) + Array(value)).join end # @return [String] def position Vedeu::Geometry::Position.new(y, x).to_s