Class: Ogg::Packet
- Inherits:
-
Object
- Object
- Ogg::Packet
- Defined in:
- lib/ogginfo-rb.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#data ⇒ Object
readonly
Returns the value of attribute data.
Instance Method Summary collapse
-
#initialize(page) ⇒ Packet
constructor
A new instance of Packet.
- #next_page ⇒ Object
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
#data ⇒ Object (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_page ⇒ Object
159 160 161 |
# File 'lib/ogginfo-rb.rb', line 159 def next_page return @last_page.next_page end |