Class: Markovian::Importers::Twitter::Tweet

Inherits:
Object
  • Object
show all
Defined in:
lib/markovian/importers/twitter/tweet.rb

Overview

Represents an individual tweet

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(text) ⇒ Tweet

Returns a new instance of Tweet.



7
8
9
# File 'lib/markovian/importers/twitter/tweet.rb', line 7

def initialize(text)
  @text = text
end

Instance Attribute Details

#textObject (readonly)

Returns the value of attribute text.



6
7
8
# File 'lib/markovian/importers/twitter/tweet.rb', line 6

def text
  @text
end

Instance Method Details

#interesting_textObject



16
17
18
# File 'lib/markovian/importers/twitter/tweet.rb', line 16

def interesting_text
  without_urls(without_leading_dot(text))
end

#mentionsObject

Not currently used, but we might want to weight mentions later.



12
13
14
# File 'lib/markovian/importers/twitter/tweet.rb', line 12

def mentions
  text.scan(/(\@[a-z0-9_]+)/).flatten
end