Class: Nugrant::Helper::Yaml
- Inherits:
-
Object
- Object
- Nugrant::Helper::Yaml
- Defined in:
- lib/nugrant/helper/yaml.rb
Class Method Summary collapse
Class Method Details
.format(string, options = {}) ⇒ Object
4 5 6 7 8 9 10 11 12 13 14 15 16 |
# File 'lib/nugrant/helper/yaml.rb', line 4 def self.format(string, = {}) lines = string.send(string.respond_to?(:lines) ? :lines : :to_s).to_a lines = lines.drop(1) if [:indent] indent_text = " " * [:indent] lines = lines.map do |line| indent_text + line end end return lines.join("") end |