lib/vedeu/output/compositor.rb in vedeu-0.0.11 vs lib/vedeu/output/compositor.rb in vedeu-0.0.12
- old
+ new
@@ -7,13 +7,11 @@
return if output.nil? || output.empty?
if output.is_a?(Array)
new(output, interface).arrange
elsif output.is_a?(Hash)
- output.map do |i, o|
- new(o, i).arrange
- end
+ output.map { |i, o| new(o, i).arrange }
end
end
end
def initialize(output = [], interface = 'dummy')
@@ -28,26 +26,29 @@
private
def composition
container = []
streams = []
+
output.map do |line|
line.each_with_index do |stream, index|
streams << clear(index)
streams << Directive.enact(stream)
end
+
container << streams.join
streams = []
end
+
container
end
def clear(index)
[origin(index), (' ' * width), origin(index)].join
end
def origin(index)
- target_interface.origin(index)
+ geometry.origin(index)
end
def width
geometry.width
end