Class: Eyemask::Liquid::Indent
- Inherits:
-
Liquid::Block
- Object
- Liquid::Block
- Eyemask::Liquid::Indent
- Defined in:
- lib/eyemask/liquid/indent.rb
Instance Method Summary collapse
-
#initialize(tag_name, markup, tokens) ⇒ Indent
constructor
A new instance of Indent.
- #render(context) ⇒ Object
Constructor Details
#initialize(tag_name, markup, tokens) ⇒ Indent
Returns a new instance of Indent.
7 8 9 10 |
# File 'lib/eyemask/liquid/indent.rb', line 7 def initialize(tag_name, markup, tokens) super @indentation = markup.to_i end |
Instance Method Details
#render(context) ⇒ Object
12 13 14 15 |
# File 'lib/eyemask/liquid/indent.rb', line 12 def render(context) prefix = " " * @indentation super.gsub(/^/, prefix) end |