Class: Net::DAAP::Database
- Inherits:
-
Object
- Object
- Net::DAAP::Database
- Defined in:
- lib/net/daap/database.rb
Overview
This class contains a database found on an iTunes server.
Constant Summary collapse
- @@SONG_ATTRIBUTES =
%w{ dmap.itemid dmap.itemname dmap.persistentid daap.songalbum daap.songartist daap.songformat daap.songsize }
Instance Attribute Summary collapse
-
#containercount ⇒ Object
readonly
Returns the value of attribute containercount.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#itemcount ⇒ Object
readonly
Returns the value of attribute itemcount.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#persistentid ⇒ Object
readonly
Returns the value of attribute persistentid.
-
#playlists ⇒ Object
readonly
Returns the playlists associated with this database.
-
#songs ⇒ Object
readonly
Returns the songs associated with this database.
Instance Method Summary collapse
-
#initialize(args) ⇒ Database
constructor
A new instance of Database.
Constructor Details
#initialize(args) ⇒ Database
Returns a new instance of Database.
11 12 13 14 15 16 17 18 19 20 |
# File 'lib/net/daap/database.rb', line 11 def initialize(args) info = args[:db_info] @persistentid = info['dmap.persistentid'] @name = info['dmap.itemname'] @containercount = info['dmap.containercount'] @id = info['dmap.itemid'] @itemcount = info['dmap.itemcount'] @daap = args[:daap] @songs = load_songs end |
Instance Attribute Details
#containercount ⇒ Object (readonly)
Returns the value of attribute containercount.
5 6 7 |
# File 'lib/net/daap/database.rb', line 5 def containercount @containercount end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
5 6 7 |
# File 'lib/net/daap/database.rb', line 5 def id @id end |
#itemcount ⇒ Object (readonly)
Returns the value of attribute itemcount.
5 6 7 |
# File 'lib/net/daap/database.rb', line 5 def itemcount @itemcount end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
5 6 7 |
# File 'lib/net/daap/database.rb', line 5 def name @name end |
#persistentid ⇒ Object (readonly)
Returns the value of attribute persistentid.
5 6 7 |
# File 'lib/net/daap/database.rb', line 5 def persistentid @persistentid end |
#playlists ⇒ Object (readonly)
Returns the playlists associated with this database
31 32 33 |
# File 'lib/net/daap/database.rb', line 31 def playlists @playlists end |
#songs ⇒ Object (readonly)
Returns the songs associated with this database
23 24 25 |
# File 'lib/net/daap/database.rb', line 23 def songs @songs end |