Class: PatientZero::Analytics::Twitter
- Inherits:
-
Base
- Object
- Base
- PatientZero::Analytics::Twitter
show all
- Defined in:
- lib/patient_zero/analytics/twitter.rb
Instance Attribute Summary
Attributes inherited from Base
#end_date, #source_id, #start_date, #token
Instance Method Summary
collapse
Methods inherited from Base
#initialize, #messages, #name, #platform, #total_posts
Methods included from Client
#connection, #get, included, #parse, #post, #put
Instance Method Details
#engagements ⇒ Object
8
9
10
|
# File 'lib/patient_zero/analytics/twitter.rb', line 8
def engagements
@engagements ||= messages.reduce(0) { |sum, message| sum + message.engagements }
end
|
#followers ⇒ Object
16
17
18
|
# File 'lib/patient_zero/analytics/twitter.rb', line 16
def followers
analytical_data['followers'].to_i
end
|
#impressions ⇒ Object
4
5
6
|
# File 'lib/patient_zero/analytics/twitter.rb', line 4
def impressions
analytical_data['total_impressions'].to_i
end
|
#impressions_by_city ⇒ Object
24
25
26
|
# File 'lib/patient_zero/analytics/twitter.rb', line 24
def impressions_by_city
{}
end
|
#likes ⇒ Object
20
21
22
|
# File 'lib/patient_zero/analytics/twitter.rb', line 20
def likes
analytical_data['total_favorites'].to_i
end
|
#reach ⇒ Object
12
13
14
|
# File 'lib/patient_zero/analytics/twitter.rb', line 12
def reach
@reach ||= (0.12 * analytical_data['followers'].to_i).round
end
|
28
29
30
|
# File 'lib/patient_zero/analytics/twitter.rb', line 28
def
nil
end
|