Class: Muwu::RenderHtmlPartial::DocumentJs

Inherits:
Object
  • Object
show all
Includes:
Muwu
Defined in:
lib/muwu/render_html_partial/render_document_js.rb

Constant Summary

Constants included from Muwu

GEM_HOME_LIB, GEM_HOME_LIB_MUWU, VERSION

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Muwu

debug, read

Instance Attribute Details

#destinationObject

Returns the value of attribute destination.



9
10
11
# File 'lib/muwu/render_html_partial/render_document_js.rb', line 9

def destination
  @destination
end

#librariesObject

Returns the value of attribute libraries.



9
10
11
# File 'lib/muwu/render_html_partial/render_document_js.rb', line 9

def libraries
  @libraries
end

#projectObject

Returns the value of attribute project.



9
10
11
# File 'lib/muwu/render_html_partial/render_document_js.rb', line 9

def project
  @project
end

Instance Method Details

#optionsObject



25
26
27
# File 'lib/muwu/render_html_partial/render_document_js.rb', line 25

def options
  @project.options
end

#renderObject



16
17
18
19
20
21
22
# File 'lib/muwu/render_html_partial/render_document_js.rb', line 16

def render
  @destination.output_stream do
    libraries.each do |library|
      write_library(library)
    end
  end
end

#write_library(library) ⇒ Object



30
31
32
# File 'lib/muwu/render_html_partial/render_document_js.rb', line 30

def write_library(library)
  @destination.write_inline RenderHtmlPartial::JsLibrary.new.find(library)
end