Class: String

Inherits:
Object
  • Object
show all
Defined in:
lib/core_ext/string.rb

Instance Method Summary collapse

Instance Method Details

#cleanquotesObject



6
7
8
# File 'lib/core_ext/string.rb', line 6

def cleanquotes
  gsub(/["']/, '')
end

#commasplitObject



2
3
4
# File 'lib/core_ext/string.rb', line 2

def commasplit
  split(',').map(&:strip)
end

#to_htmlObject



14
15
16
# File 'lib/core_ext/string.rb', line 14

def to_html
  gsub(/\n/, '<br />').gsub(/\t/, '    ')
end

#to_plaintextObject



10
11
12
# File 'lib/core_ext/string.rb', line 10

def to_plaintext
  gsub(/\n/, '\n').gsub(/\t/, '\t')
end