Class: Muwu::RenderHtmlPartialBuilder::TextBuilder

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

Constant Summary

Constants included from Muwu

GEM_HOME_LIB, GEM_HOME_LIB_MUWU, VERSION

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Muwu

debug, read

Constructor Details

#initializeTextBuilder

Returns a new instance of TextBuilder.



23
24
25
# File 'lib/muwu/render_html_partial_builder/render_text_builder.rb', line 23

def initialize
  @renderer = RenderHtmlPartial::Text.new
end

Instance Attribute Details

#manifest_textObject

Returns the value of attribute manifest_text.



9
10
11
# File 'lib/muwu/render_html_partial_builder/render_text_builder.rb', line 9

def manifest_text
  @manifest_text
end

#projectObject

Returns the value of attribute project.



9
10
11
# File 'lib/muwu/render_html_partial_builder/render_text_builder.rb', line 9

def project
  @project
end

#rendererObject

Returns the value of attribute renderer.



9
10
11
# File 'lib/muwu/render_html_partial_builder/render_text_builder.rb', line 9

def renderer
  @renderer
end

Class Method Details

.build {|builder| ... } ⇒ Object

Yields:

  • (builder)


16
17
18
19
20
# File 'lib/muwu/render_html_partial_builder/render_text_builder.rb', line 16

def self.build
  builder = new
  yield(builder)
  builder.renderer
end

Instance Method Details

#build_from_manifest_text(text) ⇒ Object



28
29
30
31
32
33
34
35
36
# File 'lib/muwu/render_html_partial_builder/render_text_builder.rb', line 28

def build_from_manifest_text(text)
  @manifest_text = text
  @project = text.project
  set_destination
  set_project
  set_text_root_name
  set_sections
  finally_set_html_attr_id
end

#finally_set_html_attr_idObject



39
40
41
# File 'lib/muwu/render_html_partial_builder/render_text_builder.rb', line 39

def finally_set_html_attr_id
  @renderer.html_attr_id = ['text', @renderer.text_root_name].join('_')
end

#set_destinationObject



44
45
46
# File 'lib/muwu/render_html_partial_builder/render_text_builder.rb', line 44

def set_destination
  @renderer.destination = @manifest_text.destination
end

#set_projectObject



49
50
51
# File 'lib/muwu/render_html_partial_builder/render_text_builder.rb', line 49

def set_project
  @renderer.project = @project
end

#set_sectionsObject



59
60
61
# File 'lib/muwu/render_html_partial_builder/render_text_builder.rb', line 59

def set_sections
  @renderer.sections = determine_sections
end

#set_text_root_nameObject



54
55
56
# File 'lib/muwu/render_html_partial_builder/render_text_builder.rb', line 54

def set_text_root_name
  @renderer.text_root_name = @manifest_text.text_root_name
end