Class: DoingStream::Streams::LastFM
- Inherits:
-
DoingStream::Stream::JSONStream
- Object
- DoingStream::Stream::Stream
- DoingStream::Stream::JSONStream
- DoingStream::Streams::LastFM
- Defined in:
- lib/doing_stream/streams/last_fm.rb
Defined Under Namespace
Classes: Entry
Constant Summary collapse
- URI =
'http://ws.audioscrobbler.com/2.0/?method=user.getrecenttracks&user=<%= user %>&format=json&limit=5&api_key=<%= api_key %>'
Instance Attribute Summary collapse
-
#api_key ⇒ Object
Returns the value of attribute api_key.
Attributes inherited from DoingStream::Stream::Stream
Instance Method Summary collapse
-
#initialize(user, options = {}) ⇒ LastFM
constructor
A new instance of LastFM.
- #json ⇒ Object
Methods inherited from DoingStream::Stream::JSONStream
Methods inherited from DoingStream::Stream::Stream
Constructor Details
#initialize(user, options = {}) ⇒ LastFM
Returns a new instance of LastFM.
7 8 9 10 |
# File 'lib/doing_stream/streams/last_fm.rb', line 7 def initialize user, = {} super @api_key = [:api_key] end |
Instance Attribute Details
#api_key ⇒ Object
Returns the value of attribute api_key.
5 6 7 |
# File 'lib/doing_stream/streams/last_fm.rb', line 5 def api_key @api_key end |
Instance Method Details
#json ⇒ Object
12 13 14 |
# File 'lib/doing_stream/streams/last_fm.rb', line 12 def json super['recenttracks']['track'] end |