Class: Rmsgen::Titleizer
- Inherits:
-
Object
- Object
- Rmsgen::Titleizer
- Defined in:
- lib/rmsgen/titleizer.rb
Constant Summary collapse
- TEMPLATE =
File.join(File.dirname(__FILE__), '..', 'templates', 'title.erb')
Instance Attribute Summary collapse
-
#title ⇒ Object
readonly
Returns the value of attribute title.
Instance Method Summary collapse
- #body ⇒ Object
-
#initialize(polnote, options = {}) ⇒ Titleizer
constructor
A new instance of Titleizer.
- #title_underscore ⇒ Object
- #to_html ⇒ Object
- #today_format ⇒ Object
- #today_underscore ⇒ Object
Constructor Details
Instance Attribute Details
#title ⇒ Object (readonly)
Returns the value of attribute title.
5 6 7 |
# File 'lib/rmsgen/titleizer.rb', line 5 def title @title end |
Instance Method Details
#body ⇒ Object
15 16 17 |
# File 'lib/rmsgen/titleizer.rb', line 15 def body ERB.new(File.read(TEMPLATE)).result(binding) end |
#title_underscore ⇒ Object
27 28 29 |
# File 'lib/rmsgen/titleizer.rb', line 27 def title_underscore @title.gsub(' ', '_') end |
#to_html ⇒ Object
31 32 33 |
# File 'lib/rmsgen/titleizer.rb', line 31 def to_html body end |
#today_format ⇒ Object
19 20 21 |
# File 'lib/rmsgen/titleizer.rb', line 19 def today_format Date.today.strftime('%d %B %Y') end |
#today_underscore ⇒ Object
23 24 25 |
# File 'lib/rmsgen/titleizer.rb', line 23 def today_underscore today_format.gsub(' ', '_') end |