class Restforce::Data::Client

Public Instance Methods

url(resource) click to toggle source

Public: Returns a url to the resource.

resource - A record that responds to to_sparam or a String/Fixnum.

Returns the url to the resource.

# File lib/restforce/data/client.rb, line 15
def url(resource)
  resource_name_for_url =
    if resource.respond_to?(:to_sparam)
      resource.to_sparam
    else
      resource
    end

  "#{instance_url}/#{resource_name_for_url}"
end