Module: Parse::API::Schema
- Included in:
- Client
- Defined in:
- lib/parse/api/schema.rb
Overview
Defines the Schema interface for the Parse REST API
Instance Method Summary collapse
-
#create_schema(className, schema) ⇒ Parse::Response
Create a new collection with the specific schema.
-
#schema(className) ⇒ Parse::Response
Get the schema for a collection.
-
#schemas(opts = {}) ⇒ Parse::Response
Get all the schemas for the application.
-
#update_schema(className, schema) ⇒ Parse::Response
Update the schema for a collection.
Instance Method Details
#create_schema(className, schema) ⇒ Parse::Response
Create a new collection with the specific schema.
41 42 43 44 |
# File 'lib/parse/api/schema.rb', line 41 def create_schema(className, schema) safe = Parse::API::PathSegment.identifier!(className, kind: "class name") request :post, "#{SCHEMAS_PATH}/#{safe}", body: schema, opts: schema_auth_opts end |
#schema(className) ⇒ Parse::Response
Get the schema for a collection.
30 31 32 33 34 |
# File 'lib/parse/api/schema.rb', line 30 def schema(className) safe = Parse::API::PathSegment.identifier!(className, kind: "class name") opts = { cache: false }.merge(schema_auth_opts) request :get, "#{SCHEMAS_PATH}/#{safe}", opts: opts end |
#schemas(opts = {}) ⇒ Parse::Response
Get all the schemas for the application.
22 23 24 25 |
# File 'lib/parse/api/schema.rb', line 22 def schemas(opts = {}) request_opts = { cache: false }.merge(schema_auth_opts).merge(opts) request :get, SCHEMAS_PATH, opts: request_opts end |
#update_schema(className, schema) ⇒ Parse::Response
Update the schema for a collection.
51 52 53 54 |
# File 'lib/parse/api/schema.rb', line 51 def update_schema(className, schema) safe = Parse::API::PathSegment.identifier!(className, kind: "class name") request :put, "#{SCHEMAS_PATH}/#{safe}", body: schema, opts: schema_auth_opts end |