Class: ZooniverseSocial::Data
- Inherits:
-
Object
- Object
- ZooniverseSocial::Data
- Defined in:
- lib/zooniverse_social/data.rb
Class Method Summary collapse
- .current ⇒ Object
- .posts ⇒ Object
- .sources ⇒ Object
- .start ⇒ Object
- .statuses ⇒ Object
- .tweets ⇒ Object
- .update ⇒ Object
Class Method Details
.current ⇒ Object
26 27 28 29 30 31 32 |
# File 'lib/zooniverse_social/data.rb', line 26 def self.current { posts: posts.data, tweets: tweets.data, statuses: statuses.data } end |
.posts ⇒ Object
10 11 12 |
# File 'lib/zooniverse_social/data.rb', line 10 def self.posts @posts ||= Posts.new end |
.sources ⇒ Object
22 23 24 |
# File 'lib/zooniverse_social/data.rb', line 22 def self.sources [posts, tweets, statuses] end |
.start ⇒ Object
38 39 40 41 |
# File 'lib/zooniverse_social/data.rb', line 38 def self.start task = Concurrent::TimerTask.new(execution_interval: 600, timeout_interval: 20, run_now: true){ update }.execute TaskObserver.new task, method(:start) end |
.statuses ⇒ Object
18 19 20 |
# File 'lib/zooniverse_social/data.rb', line 18 def self.statuses @statuses ||= Statuses.new end |
.tweets ⇒ Object
14 15 16 |
# File 'lib/zooniverse_social/data.rb', line 14 def self.tweets @tweets ||= Tweets.new end |
.update ⇒ Object
34 35 36 |
# File 'lib/zooniverse_social/data.rb', line 34 def self.update sources.each &:update end |