Sha256: ca376c022c6bf541481cd888dc0e98f008110ed31d5f35669d077a287dc4e97d
Contents?: true
Size: 342 Bytes
Versions: 10
Compression:
Stored size: 342 Bytes
Contents
class String # Matches any whitespace (including newline) and replaces with a single space # # @example # <<-QUERY.compress_lines # SELECT name # FROM users # QUERY # => "SELECT name FROM users" # def compress_lines(spaced = true) split($/).map { |line| line.strip }.join(spaced ? ' ' : '') end end
Version data entries
10 entries across 10 versions & 1 rubygems