Class: Crusoe::EntryTemplate

Inherits:
Object
  • Object
show all
Defined in:
lib/crusoe/entry_template.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(entry) ⇒ EntryTemplate

Returns a new instance of EntryTemplate.



8
9
10
# File 'lib/crusoe/entry_template.rb', line 8

def initialize(entry)
  @entry = entry
end

Instance Attribute Details

#entryObject (readonly)

Returns the value of attribute entry.



6
7
8
# File 'lib/crusoe/entry_template.rb', line 6

def entry
  @entry
end

Instance Method Details

#rendered_template_contentObject Also known as: to_s



12
13
14
15
# File 'lib/crusoe/entry_template.rb', line 12

def rendered_template_content
  markdown = ERB.new(template_content)
  markdown.result(entry.binding)
end