Class: Muwu::RenderHtml

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

Constant Summary

Constants included from Muwu

GEM_HOME_LIB, GEM_HOME_LIB_MUWU, VERSION

Instance Method Summary collapse

Methods included from Muwu

debug, read

Constructor Details

#initialize(project) ⇒ RenderHtml

Returns a new instance of RenderHtml.



8
9
10
11
12
# File 'lib/muwu/render_html/render_html.rb', line 8

def initialize(project)
  @manifest = project.manifest
  @project = project
  halt_if_project_has_fatal_exceptions
end

Instance Method Details

#renderObject



19
20
21
22
23
24
25
# File 'lib/muwu/render_html/render_html.rb', line 19

def render
  if @manifest.does_have_documents
    build_and_render(@manifest.documents)
  else
    reply_nothing_to_do
  end
end

#render_css_onlyObject



28
29
30
31
32
33
34
# File 'lib/muwu/render_html/render_html.rb', line 28

def render_css_only
  if @manifest.does_have_documents_css
    build_and_render(@manifest.documents_css)
  else
    reply_nothing_to_do
  end
end

#render_html_by_index(index) ⇒ Object



37
38
39
40
41
42
43
44
# File 'lib/muwu/render_html/render_html.rb', line 37

def render_html_by_index(index)
  document_html = @manifest.find_document_html_by_index(index)
  if document_html
    build_and_render(document_html)
  else
    reply_nothing_to_do
  end
end

#render_html_onlyObject



47
48
49
50
51
52
53
# File 'lib/muwu/render_html/render_html.rb', line 47

def render_html_only
  if @manifest.does_have_documents_html
    build_and_render(@manifest.documents_html)
  else
    reply_nothing_to_do
  end
end

#render_js_onlyObject



56
57
58
59
60
61
62
# File 'lib/muwu/render_html/render_html.rb', line 56

def render_js_only
  if @manifest.does_have_documents_js
    build_and_render(@manifest.documents_js)
  else
    reply_nothing_to_do
  end
end