Method: Dao::Path#expand!

Defined in:
lib/dao/path.rb

#expand!(params) ⇒ Object

Raises:



108
109
110
111
112
113
114
115
116
117
118
119
# File 'lib/dao/path.rb', line 108

def expand!(params)
  replace(@path.dup)
  @params = extract_params(params)
  keys.each do |key|
    next if @params[key].nil?
    re = %r{/:#{ Regexp.escape(key) }\b}
    val = "/#{ @params[key] }"
    self.gsub!(re, val)
  end
  raise(Error::Params, "#{ self }(#{ @params.inspect })") if params?
  self
end