Module: KBL::Serializable::Song

Included in:
KBL::Song
Defined in:
lib/kbl/serializable/song.rb

Instance Method Summary collapse

Instance Method Details

#to_kbl_nodeObject



5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# File 'lib/kbl/serializable/song.rb', line 5

def to_kbl_node
  doc = Nokogiri::XML.parse("    <song_data>\n      <song_name>\#{ self.name }</song_name>\n      <song_artist>\#{ self.artist }</song_artist>\n      <song_album>\#{ self.album }</song_album>\n      <song_genre>\#{ self.genre }</song_genre>\n      <song_preference>\#{ self.preference }</song_preference>\n      <song_playcnt>\#{ self.play_count }</song_playcnt>\n      <song_pathname>\#{ self.pathname }</song_pathname>\n      <song_type>\#{ self.type }</song_type>\n      <song_lyricsexist>\#{ self.has_lyrics }</song_lyricsexist>\n      <song_artist_id>\#{ self.artist_id }</song_artist_id>\n      <song_album_id>\#{ self.album_id }</song_album_id>\n      <song_song_idx>\#{ self.song_index }</song_song_idx>\n    </song_data>\n  XML\n\n  doc.root\nend\n", nil, nil, Nokogiri::XML::ParseOptions::NOBLANKS)