Class: DoingStream::Streams::StackOverflow
- Inherits:
-
DoingStream::Stream::JSONStream
- Object
- DoingStream::Stream::Stream
- DoingStream::Stream::JSONStream
- DoingStream::Streams::StackOverflow
- Defined in:
- lib/doing_stream/streams/stack_overflow.rb
Defined Under Namespace
Classes: Entry
Constant Summary collapse
- URI =
'https://api.stackexchange.com/2.0/users/<%= user %>/timeline?site=stackoverflow&pagesize=100'
Instance Attribute Summary
Attributes inherited from DoingStream::Stream::Stream
Instance Method Summary collapse
Methods inherited from DoingStream::Stream::Stream
#entry_class, #initialize, #name, #uri
Constructor Details
This class inherits a constructor from DoingStream::Stream::Stream
Instance Method Details
#body ⇒ Object
8 9 10 |
# File 'lib/doing_stream/streams/stack_overflow.rb', line 8 def body @body ||= Zlib::GzipReader.new(open(uri.to_s)).read end |
#entries ⇒ Object
16 17 18 |
# File 'lib/doing_stream/streams/stack_overflow.rb', line 16 def entries @entries ||= super.select { |entry| %w[answered asked badge].include? entry.data['timeline_type'] } end |
#json ⇒ Object
12 13 14 |
# File 'lib/doing_stream/streams/stack_overflow.rb', line 12 def json super['items'] end |