Method: String#___margin

Defined in:
lib/whitestone/support.rb

#___marginObject

adapted from ‘facets’ project



21
22
23
24
25
26
# File 'lib/whitestone/support.rb', line 21

def ___margin  # adapted from 'facets' project
  d = ((/\A.*\n\s*(.)/.match(self)) ||
      (/\A\s*(.)/.match(self)))[1]
  return '' unless d
  gsub(/\n\s*\Z/,'').gsub(/^\s*[#{d}]/, '')
end