class Restforce::SObject
def attrs
Public: Returns a hash representation of this object with the attributes
def attrs self.to_hash.reject { |key, _| key =~ /.*__r/ || key =~ /^attributes$/ } end
def describe
def describe @client.describe(sobject_type) end
def destroy
account = client.query('select Id, Name from Account').first
Examples
Public: Destroy this record.
def destroy ensure_id @client.destroy(sobject_type, self.Id) end
def ensure_id
def ensure_id raise 'You need to query the Id for the record first.' unless self.Id? end
def save
account.Name = 'Foobar'
account = client.query('select Id, Name from Account').first
Examples
Public: Persist the attributes to Salesforce.
def save ensure_id @client.update(sobject_type, attrs) end
def sobject_type
def sobject_type self.attributes.type end