Class: Clarus::Heading
- Inherits:
-
Object
- Object
- Clarus::Heading
- Defined in:
- lib/clarus/heading.rb
Instance Method Summary collapse
- #add_text(text) ⇒ Object
-
#initialize ⇒ Heading
constructor
A new instance of Heading.
- #render ⇒ Object
Constructor Details
#initialize ⇒ Heading
Returns a new instance of Heading.
3 4 5 6 |
# File 'lib/clarus/heading.rb', line 3 def initialize @style = '<w:pStyle w:val="Heading1" />' @finished_text = "" end |
Instance Method Details
#add_text(text) ⇒ Object
8 9 10 |
# File 'lib/clarus/heading.rb', line 8 def add_text(text) @finished_text.concat "<w:t>#{text}</w:t>\n" end |
#render ⇒ Object
12 13 14 15 |
# File 'lib/clarus/heading.rb', line 12 def render document_template = File.read(File.('../templates/paragraph_fragment_template.erb', __FILE__)) Erubis::Eruby.new(document_template).result(:style => @style, :finished_text => @finished_text) end |