Class: defaultType

curious.CuriousObjects.defaultType(objectData, camelCaseopt)

new defaultType(objectData, camelCaseopt)

Base (default) class for an object returned from a Curious query
Parameters:
Name Type Attributes Description
objectData Object A plain JavaScript object representing the query data, as parsed from the returned JSON
camelCase boolean <optional>
If true, construct camel-cased versions the fields in objectData
Source:

Methods

(static) fromJSON(jsonString) → {*}

When parsing a JSON string into objects, instantiate any objects that look like CuriousObject instances as such, instead of plain JavaScript objects.
Parameters:
Name Type Description
jsonString string A string of JSON-encoded data
Source:
Returns:
The instantiated JSON-encoded data, with CuriousObjects placed where appropriate
Type
*

toJSON() → {Object}

Serialize CuriousObject instances to JSON effectively if they are passed to JSON.stringify
Source:
Returns:
A plain JavaScript object containing the CuriousObject's data
Type
Object