Class: Eyemask::Liquid::Indent

Inherits:
Liquid::Block
  • Object
show all
Defined in:
lib/eyemask/liquid/indent.rb

Instance Method Summary collapse

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