Class: Alula::Hosts
Instance Attribute Summary
Attributes inherited from CDN
Instance Method Summary collapse
Methods inherited from CDN
#cdns, cdns, #initialize, load, register
Constructor Details
This class inherits a constructor from Alula::CDN
Instance Method Details
#url_for(name, opts) ⇒ Object
3 4 5 6 7 8 9 10 |
# File 'lib/alula/cdns/hosts.rb', line 3 def url_for(name, opts) if self.[0] == "/" File.join("/", name) else host = self.[Digest::MD5.hexdigest(name).to_i(16) % self..count] File.join(host, name) end end |