Class: ZeusSdk::V1::Multiplayer

Inherits:
Object
  • Object
show all
Includes:
HTTParty, ServiceBase
Defined in:
lib/zeus_sdk/v1/multiplayer.rb

Constant Summary collapse

SUBDOMAIN =
"multiplayer"
LOCAL_PORT =
3006

Instance Attribute Summary

Attributes included from ServiceBase

#env, #environment_id, #project_id, #public_key, #scope, #secret_key, #zeus_auth_key

Instance Method Summary collapse

Methods included from ServiceBase

#create_project_environment, #destroy_project_environment, #get_headers, #get_project_environment, #get_project_environments, included, #initialize, #update_project_environment

Instance Method Details

#create_document(document) ⇒ Object



16
17
18
19
20
# File 'lib/zeus_sdk/v1/multiplayer.rb', line 16

def create_document(document)
    body = {document: document}
    resp = self.class.post("/api/v1/documents", body: body.to_json, headers: self.get_headers).parsed_response
    return resp
end

#create_node(node) ⇒ Object



43
44
45
46
47
# File 'lib/zeus_sdk/v1/multiplayer.rb', line 43

def create_node(node)
    body = {node: node}
    resp = self.class.post("/api/v1/nodes", body: body.to_json, headers: self.get_headers).parsed_response
    return resp
end

#destroy_document(id) ⇒ Object



33
34
35
36
# File 'lib/zeus_sdk/v1/multiplayer.rb', line 33

def destroy_document(id)
    resp = self.class.delete("/api/v1/documents/#{id}", headers: self.get_headers).parsed_response
    return resp
end

#destroy_node(id) ⇒ Object



59
60
61
62
# File 'lib/zeus_sdk/v1/multiplayer.rb', line 59

def destroy_node(id)
    resp = self.class.delete("/api/v1/nodes/#{id}", headers: self.get_headers).parsed_response
    return resp
end

#get_document(id) ⇒ Object



22
23
24
25
# File 'lib/zeus_sdk/v1/multiplayer.rb', line 22

def get_document(id)
    resp = self.class.get("/api/v1/documents/#{id}", headers: self.get_headers).parsed_response
    return resp
end

#get_node(id) ⇒ Object



49
50
51
52
# File 'lib/zeus_sdk/v1/multiplayer.rb', line 49

def get_node(id)
    resp = self.class.get("/api/v1/nodes/#{id}", headers: self.get_headers).parsed_response
    return resp
end

#list_documents(query) ⇒ Object



11
12
13
14
# File 'lib/zeus_sdk/v1/multiplayer.rb', line 11

def list_documents(query)
    resp = self.class.get("/api/v1/documents", query: query, headers: self.get_headers).parsed_response
    return resp
end

#list_nodes(query) ⇒ Object



38
39
40
41
# File 'lib/zeus_sdk/v1/multiplayer.rb', line 38

def list_nodes(query)
    resp = self.class.get("/api/v1/nodes", query: query, headers: self.get_headers).parsed_response
    return resp
end

#update_document(id, document) ⇒ Object



27
28
29
30
31
# File 'lib/zeus_sdk/v1/multiplayer.rb', line 27

def update_document(id, document)
    body = {document: document}
    resp = self.class.put("/api/v1/documents/#{id}", body: body.to_json, headers: self.get_headers).parsed_response
    return resp
end

#update_node(id, node) ⇒ Object



54
55
56
57
# File 'lib/zeus_sdk/v1/multiplayer.rb', line 54

def update_node(id, node)
    resp = self.class.put("/api/v1/nodes/#{id}", body: {node: node}.to_json, headers: self.get_headers).parsed_response
    return resp
end