Method: Waves::Resources::Paths#generate

Defined in:
lib/waves/resources/paths.rb

#generate(template, args) ⇒ Object



11
12
13
14
15
16
17
18
19
20
21
22
# File 'lib/waves/resources/paths.rb', line 11

def generate( template, args )
  return "/" if template.empty?
  if template.is_a? Array
    if args.size == 1 and args.first.is_a? Hash
      process_hash( template, args.first )
    else
      process_array( template, args)
    end
  else
    "/#{ args * '/' }"
  end
end