Class: SwfFile::FlashFile

Inherits:
Object
  • Object
show all
Defined in:
lib/swf_file/flash_file.rb

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(swf_path) ⇒ FlashFile

Instance methods

Raises:

  • (RuntimeError)


14
15
16
17
18
# File 'lib/swf_file/flash_file.rb', line 14

def initialize(swf_path)
  raise RuntimeError, "SWF file not found.", caller unless File.exists?(swf_path)

  @header = SwfHeader.new(swf_path)
end

Class Method Details

.header(swf_path) {|header| ... } ⇒ Object

Class methods

Yields:

Raises:

  • (RuntimeError)


5
6
7
8
9
10
11
# File 'lib/swf_file/flash_file.rb', line 5

def self.header(swf_path)
  raise RuntimeError, "SWF file not found.", caller unless File.exists?(swf_path)

  header = SwfHeader.new(swf_path)
  yield(header) if block_given?
  header
end

Instance Method Details

#compressed?Boolean

Returns:

  • (Boolean)


25
26
27
# File 'lib/swf_file/flash_file.rb', line 25

def compressed?
  @header.compressed?
end

#header {|@header| ... } ⇒ Object

Yields:



20
21
22
23
# File 'lib/swf_file/flash_file.rb', line 20

def header
  yield(@header) if block_given?
  @header
end