Class: Ogg::Vorbis::CommentHeaderPacket
- Inherits:
-
HeaderPacket
- Object
- Packet
- HeaderPacket
- Ogg::Vorbis::CommentHeaderPacket
- Defined in:
- lib/ogginfo-rb.rb
Overview
Instance Attribute Summary collapse
-
#comments ⇒ Object
readonly
Returns the value of attribute comments.
-
#vendor_string ⇒ Object
readonly
Returns the value of attribute vendor_string.
Attributes inherited from HeaderPacket
Attributes inherited from Packet
Instance Method Summary collapse
-
#initialize(page) ⇒ CommentHeaderPacket
constructor
A new instance of CommentHeaderPacket.
Methods inherited from Packet
Constructor Details
#initialize(page) ⇒ CommentHeaderPacket
Returns a new instance of CommentHeaderPacket.
204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 |
# File 'lib/ogginfo-rb.rb', line 204 def initialize page super vendor_length = @data.read(4).unpack('L').first @vendor_string = @data.read(vendor_length) user_comment_list_length = @data.read(4).unpack('L').first @comments = {} user_comment_list_length.times do length = @data.read(4).unpack('L').first comment = @data.read(length) key, value = comment.split('=', 2) (@comments[key.upcase] ||= []) << value end end |
Instance Attribute Details
#comments ⇒ Object (readonly)
Returns the value of attribute comments.
202 203 204 |
# File 'lib/ogginfo-rb.rb', line 202 def comments @comments end |
#vendor_string ⇒ Object (readonly)
Returns the value of attribute vendor_string.
202 203 204 |
# File 'lib/ogginfo-rb.rb', line 202 def vendor_string @vendor_string end |