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