Class: String
Direct Known Subclasses
Instance Method Summary collapse
Instance Method Details
#coerce ⇒ Object
4 5 6 7 8 9 10 11 |
# File 'lib/microformat/string.rb', line 4 def coerce return true if self == 'true' return false if self == 'false' coerce_try { return Time.iso8601(self) } coerce_try { return Integer(self) } coerce_try { return Float(self) } self end |
#strip_html ⇒ Object
13 14 15 |
# File 'lib/microformat/string.rb', line 13 def strip_html gsub(/<(?:[^>'"]*|(['"]).*?\1)*>/,'') end |