Class: String

Inherits:
Object
  • Object
show all
Defined in:
lib/share_with/utils.rb

Overview

Monkey patching of the String class.

Instance Method Summary collapse

Instance Method Details

#to_encoded_url_paramObject



15
16
17
# File 'lib/share_with/utils.rb', line 15

def to_encoded_url_param
  ERB::Util.url_encode(self)
end

#to_escaped_htmlObject



11
12
13
# File 'lib/share_with/utils.rb', line 11

def to_escaped_html
  ERB::Util.html_escape(self)
end

#to_plain_textObject



19
20
21
# File 'lib/share_with/utils.rb', line 19

def to_plain_text
  Loofah.fragment(self).text
end