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
- .update ⇒ Object
Class Method Details
.current ⇒ Object
23 24 25 26 27 28 |
# File 'lib/zooniverse_social/data.rb', line 23 def self.current { posts: posts.data, statuses: statuses.data } end |
.posts ⇒ Object
11 12 13 |
# File 'lib/zooniverse_social/data.rb', line 11 def self.posts @posts ||= Posts.new end |
.sources ⇒ Object
19 20 21 |
# File 'lib/zooniverse_social/data.rb', line 19 def self.sources [posts, statuses] end |
.start ⇒ Object
34 35 36 37 |
# File 'lib/zooniverse_social/data.rb', line 34 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
15 16 17 |
# File 'lib/zooniverse_social/data.rb', line 15 def self.statuses @statuses ||= Statuses.new end |
.update ⇒ Object
30 31 32 |
# File 'lib/zooniverse_social/data.rb', line 30 def self.update sources.each &:update end |