Method: String#flush
- Defined in:
- lib/chef/sugar/core_extensions/string.rb
#flush ⇒ String
Left-flush a string based off of the number of whitespace characters on the first line. This is especially useful for heredocs when whitespace matters.
63 64 65 |
# File 'lib/chef/sugar/core_extensions/string.rb', line 63 def flush gsub(/^#{self[/\A\s*/]}/, '').chomp end |