Class: String
- Inherits:
-
Object
- Object
- String
- Defined in:
- lib/feed2email/core_ext.rb
Instance Method Summary collapse
- #escape_html ⇒ Object
- #numeric? ⇒ Boolean
- #pluralize(count, plural = self + 's') ⇒ Object
- #strip_html ⇒ Object
- #to_markdown ⇒ Object
Instance Method Details
#escape_html ⇒ Object
18 19 20 |
# File 'lib/feed2email/core_ext.rb', line 18 def escape_html CGI.escapeHTML(self) end |
#numeric? ⇒ Boolean
22 23 24 |
# File 'lib/feed2email/core_ext.rb', line 22 def numeric? to_i.to_s == self end |
#pluralize(count, plural = self + 's') ⇒ Object
26 27 28 |
# File 'lib/feed2email/core_ext.rb', line 26 def pluralize(count, plural = self + 's') "#{count} #{count == 1 ? self : plural}" end |
#strip_html ⇒ Object
30 31 32 |
# File 'lib/feed2email/core_ext.rb', line 30 def strip_html CGI.unescapeHTML(Sanitize.clean(self)) end |
#to_markdown ⇒ Object
34 35 36 |
# File 'lib/feed2email/core_ext.rb', line 34 def to_markdown ReverseMarkdown.convert(self, unknown_tags: :drop) end |