Class: Mastodon::Status

Inherits:
Object
  • Object
show all
Defined in:
lib/elephrame/util/status.rb

Constant Summary collapse

Decoder =
HTMLEntities.new

Instance Method Summary collapse

Instance Method Details

#is_reblog?Boolean

Returns whether or not the status is a reblogged status

Returns:

  • (Boolean)


25
26
27
# File 'lib/elephrame/util/status.rb', line 25

def is_reblog?
  not @attributes['reblog'].nil?
end

#stripString

Strips all html tags out of content

Returns:

  • (String)


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