module Restforce::Concerns::API

def select(sobject, id, select, field=nil)


field - External ID field to use (default: nil).
is passed, all fields are selected.
select - A String array denoting the fields to select. If nil or empty array
of the external field.
id - The id of the record. If field is specified, id should be the id
sobject - The String name of the sobject.

Public: Finds a single record and returns select fields.
def select(sobject, id, select, field=nil)
  path = field ? "sobjects/#{sobject}/#{field}/#{id}" : "sobjects/#{sobject}/#{id}"
  path << "?fields=#{select.join(",")}" if select && select.any?
  
  api_get(path).body
end