Class: Mastodon::Status
- Inherits:
-
Object
- Object
- Mastodon::Status
- Defined in:
- lib/elephrame/util/status.rb
Constant Summary collapse
- Decoder =
HTMLEntities.new
Instance Method Summary collapse
-
#is_reblog? ⇒ Boolean
Returns whether or not the status is a reblogged status.
-
#strip ⇒ String
Strips all html tags out of
content
.
Instance Method Details
#is_reblog? ⇒ Boolean
Returns whether or not the status is a reblogged status
25 26 27 |
# File 'lib/elephrame/util/status.rb', line 25 def is_reblog? not @attributes['reblog'].nil? end |
#strip ⇒ String
Strips all html tags out of content
14 15 16 17 18 |
# File 'lib/elephrame/util/status.rb', line 14 def strip Decoder.decode(rcontent .gsub(/(<\/p><p>|<br\s*\/?>)/, "\n") .gsub(/<("[^"]*"|'[^']*'|[^'">])*>/, '')) end |