Class: Restforce::Data::Client

Inherits:
AbstractClient show all
Includes:
Concerns::Canvas, Concerns::Picklists, Concerns::Streaming
Defined in:
lib/restforce/data/client.rb

Instance Attribute Summary

Attributes included from Concerns::Base

#options

Instance Method Summary collapse

Methods included from Concerns::Canvas

#decode_signed_request

Methods included from Concerns::Picklists

#picklist_values

Methods included from Concerns::Streaming

#faye, #subscribe

Methods included from Concerns::API

#create, #create!, #describe, #describe_layouts, #destroy, #destroy!, #explain, #find, #get_deleted, #get_updated, #limits, #list_sobjects, #org_id, #query, #query_all, #recent, #search, #select, #update, #update!, #upsert, #upsert!, #user_info

Methods included from Concerns::Verbs

#define_api_verb, #define_verb, #define_verbs

Methods included from Concerns::Caching

#without_caching

Methods included from Concerns::Authentication

#authenticate!, #authentication_middleware, #oauth_refresh?, #username_password?

Methods included from Concerns::Connection

#middleware

Methods included from Concerns::Base

#initialize, #inspect, #instance_url

Instance Method Details

#url(resource) ⇒ Object

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.



13
14
15
16
17
18
19
20
21
22
# File 'lib/restforce/data/client.rb', line 13

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