Class: Runtime

Inherits:
Object
  • Object
show all
Defined in:
lib/swftly/runtime.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(markup) ⇒ Runtime

Returns a new instance of Runtime.



4
5
6
7
# File 'lib/swftly/runtime.rb', line 4

def initialize(markup)
  @markup = markup
  @urls = URI::extract @markup
end

Instance Attribute Details

#markupObject (readonly)

Returns the value of attribute markup.



2
3
4
# File 'lib/swftly/runtime.rb', line 2

def markup
  @markup
end

Instance Method Details

#urlObject



13
14
15
# File 'lib/swftly/runtime.rb', line 13

def url
  @urls.detect { |d| d.match /runtime\.js/} #typically the first js file in the set.
end

#versionObject



9
10
11
# File 'lib/swftly/runtime.rb', line 9

def version
  url.split('/')[-2] #we'll strip out runtime version here
end