Class: Henshin::LiquidPlugin::Include
- Inherits:
-
Liquid::Tag
- Object
- Liquid::Tag
- Henshin::LiquidPlugin::Include
- Defined in:
- lib/henshin/plugins/liquid.rb
Instance Method Summary collapse
-
#initialize(tag_name, file, tokens) ⇒ Include
constructor
A new instance of Include.
- #render(context) ⇒ Object
Constructor Details
#initialize(tag_name, file, tokens) ⇒ Include
Returns a new instance of Include.
48 49 50 51 |
# File 'lib/henshin/plugins/liquid.rb', line 48 def initialize(tag_name, file, tokens) super @file = file.strip end |
Instance Method Details
#render(context) ⇒ Object
53 54 55 56 |
# File 'lib/henshin/plugins/liquid.rb', line 53 def render(context) include = File.join(context.registers[:include_dir], @file) File.open(include, 'r') {|f| f.read} end |