Class: Net::DAAP::Database

Inherits:
Object
  • Object
show all
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

Instance Method Summary collapse

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

#containercountObject (readonly)

Returns the value of attribute containercount.



5
6
7
# File 'lib/net/daap/database.rb', line 5

def containercount
  @containercount
end

#idObject (readonly)

Returns the value of attribute id.



5
6
7
# File 'lib/net/daap/database.rb', line 5

def id
  @id
end

#itemcountObject (readonly)

Returns the value of attribute itemcount.



5
6
7
# File 'lib/net/daap/database.rb', line 5

def itemcount
  @itemcount
end

#nameObject (readonly)

Returns the value of attribute name.



5
6
7
# File 'lib/net/daap/database.rb', line 5

def name
  @name
end

#persistentidObject (readonly)

Returns the value of attribute persistentid.



5
6
7
# File 'lib/net/daap/database.rb', line 5

def persistentid
  @persistentid
end

#playlistsObject (readonly)

Returns the playlists associated with this database



31
32
33
# File 'lib/net/daap/database.rb', line 31

def playlists
  @playlists
end

#songsObject (readonly)

Returns the songs associated with this database



23
24
25
# File 'lib/net/daap/database.rb', line 23

def songs
  @songs
end