Class: SocialCurrent::Stream
- Inherits:
-
Object
- Object
- SocialCurrent::Stream
- Defined in:
- lib/social_current/stream.rb
Instance Method Summary collapse
- #build ⇒ Object
-
#initialize(options) ⇒ Stream
constructor
A new instance of Stream.
Constructor Details
#initialize(options) ⇒ Stream
Returns a new instance of Stream.
3 4 5 |
# File 'lib/social_current/stream.rb', line 3 def initialize() @options = .reject { |k, v| !SUPPORTED_INTEGRATIONS.include?(k) || v.nil? } end |
Instance Method Details
#build ⇒ Object
7 8 9 10 11 |
# File 'lib/social_current/stream.rb', line 7 def build @stream ||= @options.collect do |k, v| eval("SocialCurrent::" + k.to_s.capitalize + "Service").new(v).stream end.flatten.sort_by { |k, v| k[:created_at] }.reject { |k, v| k[:message].nil? }.reverse end |