Method: RHC::Rest::Base#link_href

Defined in:
lib/rhc/rest/base.rb


54
55
56
57
58
59
60
61
# File 'lib/rhc/rest/base.rb', line 54

def link_href(sym, params=nil, resource=nil, &block)
  if (l = link(sym)) && (h = l['href'])
    h = h.gsub(/:\w+/){ |s| params[s].nil? ? s : CGI.escape(params[s]) } if params
    h = "#{h}/#{resource}" if resource
    return h
  end
  yield if block_given?
end