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.
33 34 35 36 |
# File 'lib/parse/api/schema.rb', line 33 def create_schema(className, schema) safe = Parse::API::PathSegment.identifier!(className, kind: "class name") request :post, "#{SCHEMAS_PATH}/#{safe}", body: schema end |
#schema(className) ⇒ Parse::Response
Get the schema for a collection.
22 23 24 25 26 |
# File 'lib/parse/api/schema.rb', line 22 def schema(className) safe = Parse::API::PathSegment.identifier!(className, kind: "class name") opts = { cache: false } request :get, "#{SCHEMAS_PATH}/#{safe}", opts: opts end |
#schemas(opts = {}) ⇒ Parse::Response
Get all the schemas for the application.
14 15 16 17 |
# File 'lib/parse/api/schema.rb', line 14 def schemas(opts = {}) request_opts = { cache: false }.merge(opts) request :get, SCHEMAS_PATH, opts: request_opts end |
#update_schema(className, schema) ⇒ Parse::Response
Update the schema for a collection.
43 44 45 46 |
# File 'lib/parse/api/schema.rb', line 43 def update_schema(className, schema) safe = Parse::API::PathSegment.identifier!(className, kind: "class name") request :put, "#{SCHEMAS_PATH}/#{safe}", body: schema end |