Class: Codex::Content
- Inherits:
-
Object
- Object
- Codex::Content
- Defined in:
- lib/codex/content.rb
Instance Method Summary collapse
-
#initialize(filename) ⇒ Content
constructor
A new instance of Content.
- #to_html ⇒ Object
Constructor Details
#initialize(filename) ⇒ Content
Returns a new instance of Content.
5 6 7 8 |
# File 'lib/codex/content.rb', line 5 def initialize(filename) @filename = filename @original = File.read(@filename).sub(/__END__.*/m, '').gsub(/__SKIP__.*?__ENDSKIP__/m, '') end |
Instance Method Details
#to_html ⇒ Object
10 11 12 13 14 |
# File 'lib/codex/content.rb', line 10 def to_html content = Codex::Filters.instance.filter_all(@original) html = Codex::TemplateHandler.choose(@filename).call(content) Codex::PostProcessors.instance.process_all(html) end |