lib/databasedotcom/client.rb in databasedotcom-1.0.6 vs lib/databasedotcom/client.rb in databasedotcom-1.0.7
- old
+ new
@@ -145,9 +145,15 @@
end
classes.length == 1 ? classes.first : classes
end
+ # Returns an Array of Hashes listing the properties for every type of _Sobject_ in the database. Raises SalesForceError if an error occurs.
+ def describe_sobjects
+ result = http_get("/services/data/v#{self.version}/sobjects")
+ JSON.parse(result.body)["sobjects"]
+ end
+
# Returns a description of the Sobject specified by _class_name_. The description includes all fields and their properties for the Sobject.
def describe_sobject(class_name)
result = http_get("/services/data/v#{self.version}/sobjects/#{class_name}/describe")
JSON.parse(result.body)
end