Class: Thwomp::Downloader

Inherits:
Struct
  • Object
show all
Defined in:
lib/thwomp/downloader.rb

Overview

Downloads SWF files

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#swf_urlObject

Returns the value of attribute swf_url

Returns:

  • (Object)

    the current value of swf_url



3
4
5
# File 'lib/thwomp/downloader.rb', line 3

def swf_url
  @swf_url
end

Instance Method Details

#filenameObject

returns filename of local/remote file



16
17
18
# File 'lib/thwomp/downloader.rb', line 16

def filename
  local?? swf_url : tmp_file.path
end

#local?Boolean

tests if the given file is local

Returns:

  • (Boolean)


11
12
13
# File 'lib/thwomp/downloader.rb', line 11

def local?
  !remote?
end

#remote?Boolean

tests if the given file remote

Returns:

  • (Boolean)


6
7
8
# File 'lib/thwomp/downloader.rb', line 6

def remote?
  swf_url =~ /^http(s)?::/
end