Class: Gumdrop::GeneratedContent
- Defined in:
- lib/gumdrop/generator.rb
Instance Attribute Summary
Attributes inherited from Content
#ext, #filename, #full_path, #ignored, #level, #params, #path, #site, #slug, #source_filename, #template, #type, #uri
Instance Method Summary collapse
-
#initialize(path, block, site, params = {}) ⇒ GeneratedContent
constructor
Nothing special, per se…
- #render(context = nil, ignore_layout = false, reset_context = true, locals = {}) ⇒ Object
- #useLayout? ⇒ Boolean
Methods inherited from Content
#copyTo, #mtime, #renderTo, #to_s
Constructor Details
#initialize(path, block, site, params = {}) ⇒ GeneratedContent
Nothing special, per se…
141 142 143 144 |
# File 'lib/gumdrop/generator.rb', line 141 def initialize(path, block, site, params={}) @content_block= block super(path, site, params) end |
Instance Method Details
#render(context = nil, ignore_layout = false, reset_context = true, locals = {}) ⇒ Object
146 147 148 149 150 151 152 |
# File 'lib/gumdrop/generator.rb', line 146 def render(context=nil, ignore_layout=false, reset_context=true, locals={}) if @content_block.nil? super(context, ignore_layout, reset_context, locals) else @content_block.call end end |
#useLayout? ⇒ Boolean
154 155 156 |
# File 'lib/gumdrop/generator.rb', line 154 def useLayout? !@content_block.nil? or !@template.nil? end |