Class: Vedeu::RenderInterface

Inherits:
Object
  • Object
show all
Defined in:
lib/vedeu/output/render_interface.rb

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(interface) ⇒ RenderInterface



9
10
11
# File 'lib/vedeu/output/render_interface.rb', line 9

def initialize(interface)
  @interface = interface
end

Class Method Details

.call(interface) ⇒ Object



5
6
7
# File 'lib/vedeu/output/render_interface.rb', line 5

def self.call(interface)
  new(interface).render
end

Instance Method Details

#renderObject



13
14
15
16
17
18
19
20
# File 'lib/vedeu/output/render_interface.rb', line 13

def render
  out = [ClearInterface.call(interface)]
  interface.lines.each_with_index do |line, index|
    out << interface.origin(index)
    out << line.to_s
  end
  out.join
end