Class: Rmsgen::Titleizer

Inherits:
Object
  • Object
show all
Defined in:
lib/rmsgen/titleizer.rb

Constant Summary collapse

SPACE =
' '
UNDERSCORE =
'_'
TEMPLATE =
File.join(File.dirname(__FILE__), '..', 'templates', 'title.erb')

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(polnote, options = {}) ⇒ Titleizer

Returns a new instance of Titleizer.



10
11
12
13
14
15
# File 'lib/rmsgen/titleizer.rb', line 10

def initialize(polnote, options={})
  @title   = options[:title]
  @body    = polnote.body
  @script  = Script.new($stdout)
  run!
end

Instance Attribute Details

#titleObject (readonly)

Returns the value of attribute title.



8
9
10
# File 'lib/rmsgen/titleizer.rb', line 8

def title
  @title
end

Instance Method Details

#to_htmlObject



17
18
19
# File 'lib/rmsgen/titleizer.rb', line 17

def to_html
  ERB.new(File.read(TEMPLATE)).result(binding)
end