Class: AirVideo::AvMap::BinaryData
Overview
A simple container for Binary Data. With AirVideo this is used to hold thumbnail JPG data.
Instance Attribute Summary collapse
-
#data ⇒ Object
readonly
Returns the value of attribute data.
Instance Method Summary collapse
-
#initialize(data) ⇒ BinaryData
constructor
Not really useful outside of the AvMap module.
- #inspect ⇒ Object
- #length ⇒ Object
-
#write_to(filename) ⇒ Object
Writes the data to the given filename.
Constructor Details
#initialize(data) ⇒ BinaryData
Not really useful outside of the AvMap module
378 379 380 |
# File 'lib/airvideo.rb', line 378 def initialize(data) # :nodoc: @data = data end |
Instance Attribute Details
#data ⇒ Object (readonly)
Returns the value of attribute data.
375 376 377 |
# File 'lib/airvideo.rb', line 375 def data @data end |
Instance Method Details
#inspect ⇒ Object
395 396 397 |
# File 'lib/airvideo.rb', line 395 def inspect "<Data: #{@data.length} bytes>" end |
#length ⇒ Object
391 392 393 |
# File 'lib/airvideo.rb', line 391 def length @data.length end |
#write_to(filename) ⇒ Object
Writes the data to the given filename
TODO: LibMagic to detect what the extension should be?
385 386 387 388 389 |
# File 'lib/airvideo.rb', line 385 def write_to(filename) open(filename,"w") do |f| f.write @data end end |