Class: String

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

Instance Method Summary collapse

Instance Method Details

#parse_intObject



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

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

#strip_heredocObject



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