Class: Muwu::RenderHtmlPartial::Title

Inherits:
Object
  • Object
show all
Includes:
Muwu
Defined in:
lib/muwu/render_html_partial/render_title.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_title.rb', line 9

def destination
  @destination
end

#metadataObject

Returns the value of attribute metadata.



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

def 
  @metadata
end

Instance Method Details

#renderObject



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

def render
  @destination.margin_to_zero
  @destination.padding_vertical(1) do
    write_tag_div_open
    
    write_tag_div_close
  end
  @destination.margin_to_zero
end

#render_title_metadataObject



26
27
28
29
30
31
32
# File 'lib/muwu/render_html_partial/render_title.rb', line 26

def 
  @destination.margin_indent do 
    @metadata.each_pair do |key, value|
      write_tag_h1(key, value)
    end
  end
end

#write_tag_div_closeObject



35
36
37
# File 'lib/muwu/render_html_partial/render_title.rb', line 35

def write_tag_div_close
  @destination.write_line tag_div_close
end

#write_tag_div_openObject



40
41
42
# File 'lib/muwu/render_html_partial/render_title.rb', line 40

def write_tag_div_open
  @destination.write_line tag_div_open
end

#write_tag_h1(key, value) ⇒ Object



45
46
47
# File 'lib/muwu/render_html_partial/render_title.rb', line 45

def write_tag_h1(key, value)
  @destination.write_line tag_h1(key, value)
end