class ZeusClient::V1::Multiplayer

Constants

LOCAL_PORT
SUBDOMAIN

Public Instance Methods

create_document(document) click to toggle source
# File lib/zeus/v1/client/multiplayer.rb, line 20
def create_document(document)
    resp = self.class.post("/api/v1/documents", body: {document: document}.to_json, headers: self.get_headers).parsed_response
    if resp["success"] == true
        return Document.new(resp["object"])
    else
        return nil
    end
end
create_node(node) click to toggle source
# File lib/zeus/v1/client/multiplayer.rb, line 65
def create_node(node)
    resp = self.class.post("/api/v1/nodes", body: {node: node}.to_json, headers: self.get_headers).parsed_response
    if resp["success"] == true
        return Node.new(resp["object"])
    else
        return nil
    end
end
destroy_document(id) click to toggle source
# File lib/zeus/v1/client/multiplayer.rb, line 47
def destroy_document(id)
    resp = self.class.delete("/api/v1/documents/#{id}", headers: self.get_headers).parsed_response
    if resp["success"] == true
        return Document.new(resp["object"])
    else
        return nil
    end
end
destroy_node(id) click to toggle source
# File lib/zeus/v1/client/multiplayer.rb, line 92
def destroy_node(id)
    resp = self.class.delete("/api/v1/nodes/#{id}", headers: self.get_headers).parsed_response
    if resp["success"] == true
        return Node.new(resp["object"])
    else
        return nil
    end
end
get_document(id) click to toggle source
# File lib/zeus/v1/client/multiplayer.rb, line 29
def get_document(id)
    resp = self.class.get("/api/v1/documents/#{id}", headers: self.get_headers).parsed_response
    if resp["success"] == true
        return Document.new(resp["object"])
    else
        return nil
    end
end
get_node(id) click to toggle source
# File lib/zeus/v1/client/multiplayer.rb, line 74
def get_node(id)
    resp = self.class.get("/api/v1/nodes/#{id}", headers: self.get_headers).parsed_response
    if resp["success"] == true
        return Node.new(resp["object"])
    else
        return nil
    end
end
list_documents(query) click to toggle source
# File lib/zeus/v1/client/multiplayer.rb, line 11
def list_documents(query)
    resp = self.class.get("/api/v1/documents", query: query, headers: self.get_headers).parsed_response
    if resp["success"] == true
        return resp["objects"].map {|d| Document.new(d) }
    else
        return nil
    end
end
list_nodes(query) click to toggle source
# File lib/zeus/v1/client/multiplayer.rb, line 56
def list_nodes(query)
    resp = self.class.get("/api/v1/nodes", query: query, headers: self.get_headers).parsed_response
    if resp["success"] == true
        return resp["objects"].map {|d| Node.new(d) }
    else
        return nil
    end
end
update_document(id, document) click to toggle source
# File lib/zeus/v1/client/multiplayer.rb, line 38
def update_document(id, document)
    resp = self.class.put("/api/v1/documents/#{id}", body: {document: document}.to_json, headers: self.get_headers).parsed_response
    if resp["success"] == true
        return Document.new(resp["object"])
    else
        return nil
    end
end
update_node(id, node) click to toggle source
# File lib/zeus/v1/client/multiplayer.rb, line 83
def update_node(id, node)
    resp = self.class.put("/api/v1/nodes/#{id}", body: {node: node}.to_json, headers: self.get_headers).parsed_response
    if resp["success"] == true
        return Node.new(resp["object"])
    else
        return nil
    end
end