Skip to content

Commit 8ff8c66

Browse files
committed
OTHER: Update the ruby tutorials.
1 parent b47d7f5 commit 8ff8c66

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

ruby/tut3.rb

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,11 @@
111111
# info[], we'll use an 'each' method instead. The 'each' method is
112112
# similar to Hash#each, except that there's an additional source
113113
# argument passed to the block.
114-
info.each_pair { |src, key, val| puts "[#{src}] #{key} = #{val}" }
114+
info.each_pair { |key, data|
115+
data.each_pair { |src, val|
116+
puts "[#{src}] #{key} = #{val}"
117+
}
118+
}
115119
# Wow, that whole table was printed out with one line of code!
116120

117121
# And, of course we check for errors since we want a bulletproof

ruby/tut4.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@
5454
end
5555
begin
5656
# Remember, the playlist array is zero-indexed!
57-
puts "#{index + 1}. #{xmms.medialib_get_info(id).wait.value[:url]}"
57+
puts "#{index + 1}. #{xmms.medialib_get_info(id).wait.value.to_propdict[:url]}"
5858
# It's possible that the URL isn't defined by the server, like if
5959
# you added a non-media file to the playlist. You should keep that
6060
# in mind when writing a client, but in this case PropDict#[:url]

0 commit comments

Comments
 (0)