Class: SocialCurrent::Stream

Inherits:
Object
  • Object
show all
Defined in:
lib/social_current/stream.rb

Instance Method Summary collapse

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)
  @options = options.reject { |k, v| !SUPPORTED_INTEGRATIONS.include?(k) || v.nil? }
end

Instance Method Details

#buildObject



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