Class: String
Instance Method Summary collapse
Instance Method Details
#parse_int ⇒ Object
9 10 11 |
# File 'lib/ficrip/extensions.rb', line 9 def parse_int gsub(/[^\d]/, '').to_i end |
#strip_heredoc ⇒ Object
13 14 15 16 |
# File 'lib/ficrip/extensions.rb', line 13 def strip_heredoc indent = scan(/^[ \t]*(?=\S)/).min.size || 0 gsub(/^[ \t]{#{indent}}/, '') end |