carldr-scrobble.rb 0.0.1 → 0.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/lib/scrobble/track.rb +5 -1
- metadata +2 -2
data/lib/scrobble/track.rb
CHANGED
@@ -1,12 +1,16 @@
|
|
1
1
|
module Scrobble
|
2
2
|
class Track < Base
|
3
3
|
# FIXME: We really want this to be attr_reader, but new_from_element needs to write. Perhaps emulate Rails' ability to pass a block.
|
4
|
-
attr_accessor :name, :
|
4
|
+
attr_accessor :name, :artist, :album
|
5
|
+
attr_accessor :now_playing
|
5
6
|
|
6
7
|
def self.new_from_element( element, doc )
|
7
8
|
t = Track.new
|
9
|
+
|
8
10
|
t.now_playing = !!element[ "nowplaying" ]
|
9
11
|
t.name = (element/"name").inner_text
|
12
|
+
t.artist = (element/"artist").inner_text
|
13
|
+
t.album = (element/"album").inner_text
|
10
14
|
|
11
15
|
t
|
12
16
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: carldr-scrobble.rb
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Carl Drinkwater
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2008-10-
|
12
|
+
date: 2008-10-09 00:00:00 -07:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|