Class: DoingStream::Streams::LastFM::Entry

Inherits:
DoingStream::Stream::Entry show all
Defined in:
lib/doing_stream/streams/last_fm.rb

Instance Attribute Summary

Attributes inherited from DoingStream::Stream::Entry

#data, #name

Instance Method Summary collapse

Methods inherited from DoingStream::Stream::Entry

#to_h, #to_json

Instance Method Details

#publishedObject



17
18
19
20
21
22
23
# File 'lib/doing_stream/streams/last_fm.rb', line 17

def published
  if data['@attr'] && data['@attr']['nowplaying'] == 'true'
    Time.now
  else
    Time.at data['date']['uts'].to_i
  end
end