Class: DoingStream::Stream::JSONStream
- Defined in:
- lib/doing_stream/stream/json_stream.rb
Direct Known Subclasses
DoingStream::Streams::GitHub, DoingStream::Streams::LastFM, DoingStream::Streams::StackOverflow, DoingStream::Streams::Twitter, DoingStream::Streams::Vimeo::Likes, DoingStream::Streams::Vimeo::Videos
Instance Attribute Summary
Attributes inherited from Stream
Instance Method Summary collapse
Methods inherited from Stream
#entry_class, #initialize, #name, #uri
Constructor Details
This class inherits a constructor from DoingStream::Stream::Stream
Instance Method Details
#body ⇒ Object
6 7 8 |
# File 'lib/doing_stream/stream/json_stream.rb', line 6 def body @body ||= Curl::Easy.perform(uri.to_s).body_str end |
#entries ⇒ Object
14 15 16 17 18 |
# File 'lib/doing_stream/stream/json_stream.rb', line 14 def entries @entries ||= json.map do |entry| entry_class.new(name, entry) end end |
#json ⇒ Object
10 11 12 |
# File 'lib/doing_stream/stream/json_stream.rb', line 10 def json JSON.parse body end |