mirror of
https://github.com/haml/haml.git
synced 2022-11-09 12:33:31 -05:00
12 lines
231 B
Ruby
12 lines
231 B
Ruby
|
module PrettyHamlit
|
||
|
class DynamicIndentation
|
||
|
class << self
|
||
|
def indent_with(indent_level)
|
||
|
indent = "\n" << ' ' * indent_level
|
||
|
text = yield('')
|
||
|
text.gsub("\n", indent)
|
||
|
end
|
||
|
end
|
||
|
end
|
||
|
end
|