Class: String

Inherits:
Object show all
Defined in:
lib/swee/support.rb

Constant Summary collapse

BLANK_RE =
/\A[[:space:]]*\z/

Instance Method Summary collapse

Instance Method Details

#blank?Boolean

Returns:

  • (Boolean)


67
68
69
# File 'lib/swee/support.rb', line 67

def blank?
  BLANK_RE === self
end

#html_safeObject



71
72
73
# File 'lib/swee/support.rb', line 71

def html_safe
  self.gsub /[&"'><]/, { '&' => '&amp;',  '>' => '&gt;',   '<' => '&lt;', '"' => '&quot;', "'" => '&#39;' }
end