Class: String

Inherits:
Object show all
Defined in:
lib/ficrip/extensions.rb

Instance Method Summary collapse

Instance Method Details

#parse_intObject



9
10
11
# File 'lib/ficrip/extensions.rb', line 9

def parse_int
  gsub(/[^\d]/, '').to_i
end

#strip_heredocObject



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