module LC::Protocol
A module which encapsulates the specifics of Parse's REST API.
Constants
- BATCH_REQUEST_URI
- CLASS_INSTALLATION
- CLASS_USER
The class name for
User
objects, when referenced by aPointer
.- CLOUD_FUNCTIONS_PATH
- DELETE_OP
- ERROR_EXCEEDED_BURST_LIMIT
- ERROR_INTERNAL
- ERROR_OBJECT_NOT_FOUND_FOR_GET
- ERROR_TIMEOUT
- HEADER_API_KEY
The HTTP header used for passing your API Sign to the Parse API.
- HEADER_APP_ID
The HTTP header used for passing your application ID to the Parse API.
- HEADER_SESSION_TOKEN
The HTTP header used for passing your authenticated session
- HOST
The default hostname for communication with the Parse API.
- KEY_ADD
- KEY_ADD_RELATION
- KEY_ADD_UNIQUE
- KEY_AMOUNT
The JSON key used to specify the numerical value in the increment/decrement API call.
- KEY_CLASS_NAME
The JSON key used to store the class name of an object in a
Pointer
datatype.- KEY_CREATED_AT
The JSON key used to store the creation timestamp of Parse objects in their JSON representation.
- KEY_DELETE
- KEY_INCREMENT
- KEY_OBJECTS
array ops
- KEY_OBJECT_ID
The JSON key used to store the ID of Parse objects in their JSON representation.
- KEY_OP
The JSON key used to identify an operator
- KEY_REMOVE
- KEY_REMOVE_RELATION
- KEY_RESULTS
- KEY_TYPE
The JSON key used to identify the datatype of a special value.
- KEY_UPDATED_AT
The JSON key used to store the last modified timestamp of Parse objects in their JSON representation.
- KEY_USER_SESSION_TOKEN
- OP_INCREMENT
Operation name for incrementing an objects field value remotely
- PASSWORD_RESET_URI
- RESERVED_KEYS
- RESPONSE_KEY_RESULTS
The JSON key used in the top-level response object to indicate that the response contains an array of objects.
- SMS_URI
- TYPE_BYTES
The data type name for special JSON objects containing an array of encoded bytes.
- TYPE_DATE
The data type name for special JSON objects representing a date/time.
- TYPE_FILE
The data type name for special JSON objects representing a file.
- TYPE_GEOPOINT
The data type name for special JSON objects representing a location specified as a latitude/longitude pair.
- TYPE_OBJECT
The data type name for special JSON objects representing a full object
- TYPE_POINTER
The data type name for special JSON objects representing a reference to another Parse object.
- TYPE_RELATION
The data type name for special JSON objects representing a Relation.
- USER_CURRENT_URI
- USER_LOGIN_URI
- VERSION
The version of the REST API implemented by this module.
Public Class Methods
# File lib/leancloud/protocol.rb, line 193 def Protocol.batch_request_uri "/#{VERSION}/#{BATCH_REQUEST_URI}" end
Construct a uri referencing a given Parse object class or instance (of object_id is non-nil).
# File lib/leancloud/protocol.rb, line 147 def Protocol.class_uri(class_name, object_id = nil) if object_id "/#{VERSION}/classes/#{class_name}/#{object_id}" else "/#{VERSION}/classes/#{class_name}" end end
# File lib/leancloud/protocol.rb, line 189 def Protocol.cloud_function_uri(function_name) "/#{VERSION}/#{CLOUD_FUNCTIONS_PATH}/#{function_name}" end
URI Helpers
# File lib/leancloud/protocol.rb, line 141 def Protocol.config_uri "/#{VERSION}/config" end
# File lib/leancloud/protocol.rb, line 185 def Protocol.cql_uri "/#{VERSION}/cloudQuery" end
Construct a uri referencing a file stored by the API.
# File lib/leancloud/protocol.rb, line 176 def Protocol.file_uri(file_name) "/#{VERSION}/files/#{file_name}" end
Construct a uri referencing a given Parse installation class or instance (of object_id is non-nil).
# File lib/leancloud/protocol.rb, line 157 def Protocol.installation_uri(object_id = nil) if object_id "/#{VERSION}/installations/#{object_id}" else "/#{VERSION}/installations" end end
Construct a uri to send a push notification via the API.
# File lib/leancloud/protocol.rb, line 181 def Protocol.push_uri "/#{VERSION}/push" end
Construct a uri referencing a given Parse user instance or the users category.
# File lib/leancloud/protocol.rb, line 167 def Protocol.user_uri(user_id = nil) if user_id "/#{VERSION}/users/#{user_id}" else "/#{VERSION}/users" end end