jdfrens / calvincs

Ruby on Rails Website for Computer Science Department at Calvin College

This URL has Read+Write access

jdfrens (author)
Wed Jul 08 12:32:01 -0700 2009
commit  d5e5cc67dad928bccd015f13e1b33f4a438ade96
tree    671fadb373acabf75715af8ea0b44a68efcd51b6
parent  c4485110361544fd11149cf69d1b01f9644efa0f
calvincs / deployment / support / resource_path.rb
100644 19 lines (13 sloc) 0.252 kb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
class ResourcePath
 
  attr_writer :param
 
  def initialize(path, options = {})
    @path = path
    @param = options[:param]
  end
 
  def param
    @param ||= (0...8).map{65.+(rand(25)).chr}.join
  end
 
  def to_s
    @path.gsub('*', param)
  end
 
end