Class: Vedeu::Output

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

Overview

Sends the content to the renderers.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(content) ⇒ Output

Return a new instance of Vedeu::Output.

Parameters:



18
19
20
# File 'lib/vedeu/output/output.rb', line 18

def initialize(content)
  @content = content
end

Instance Attribute Details

#contentArray<Array<Vedeu::Char>> (readonly, protected)

Returns:



39
40
41
# File 'lib/vedeu/output/output.rb', line 39

def content
  @content
end

Class Method Details

.render(content) ⇒ Array|String

Writes content to the defined renderers.

Returns:

  • (Array|String)

See Also:



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

def self.render(content)
  new(content).render
end

Instance Method Details

#renderArray

Send the view to the renderers.

Returns:

  • (Array)


25
26
27
28
29
30
31
32
33
# File 'lib/vedeu/output/output.rb', line 25

def render
  if Vedeu::Configuration.drb?
    Vedeu.trigger(:_drb_store_output_, content)

    Vedeu::Renderers::HTML.to_file(Vedeu::VirtualBuffer.retrieve)
  end

  Vedeu.renderers.render(content)
end