Class: Ogg::Packet

Inherits:
Object
  • Object
show all
Defined in:
lib/ogginfo-rb.rb

Direct Known Subclasses

Vorbis::HeaderPacket

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(page) ⇒ Packet

Returns a new instance of Packet.



147
148
149
150
151
152
153
154
155
156
157
# File 'lib/ogginfo-rb.rb', line 147

def initialize page
  @data = StringIO.new('', 'w+')
  @data.write(page.data.read)
  while page.continues?
    page = page.next_page
    @data.write(page.data.read)
  end
  @last_page = page
  @data.close_write
  @data.rewind
end

Instance Attribute Details

#dataObject (readonly)

Returns the value of attribute data.



145
146
147
# File 'lib/ogginfo-rb.rb', line 145

def data
  @data
end

Instance Method Details

#next_pageObject



159
160
161
# File 'lib/ogginfo-rb.rb', line 159

def next_page
  return @last_page.next_page
end