Class: PairProgrammer::Api::Planner

Inherits:
Object
  • Object
show all
Defined in:
lib/pairprogrammer/api/planner.rb

Class Method Summary collapse

Class Method Details

.create(context, requirements) ⇒ Object



5
6
7
8
9
10
11
12
# File 'lib/pairprogrammer/api/planner.rb', line 5

def self.create(context, requirements)
    body = {
        context: context,
        requirements: requirements,
    }
    response = Client.new.post('/api/v1/planner', body)
    response["id"]
end

.generate_tasks(id) ⇒ Object



40
41
42
43
44
45
# File 'lib/pairprogrammer/api/planner.rb', line 40

def self.generate_tasks(id)
    body = {
        id: id
    }
    Client.new.post('/api/v1/planner/generate_tasks', body)
end

.listObject



28
29
30
# File 'lib/pairprogrammer/api/planner.rb', line 28

def self.list
    Client.new.get('/api/v1/planner/list', {})
end

.messages(id) ⇒ Object



14
15
16
17
18
19
# File 'lib/pairprogrammer/api/planner.rb', line 14

def self.messages(id)
    query = {
        id: id
    }
    Client.new.get('/api/v1/planner/get_messages', query)
end

.respond(id, content) ⇒ Object



32
33
34
35
36
37
38
# File 'lib/pairprogrammer/api/planner.rb', line 32

def self.respond(id, content)
    body = {
        id: id,
        content: content
    }
    Client.new.post('/api/v1/planner/respond', body)
end

.run(id) ⇒ Object



21
22
23
24
25
26
# File 'lib/pairprogrammer/api/planner.rb', line 21

def self.run(id)
    body = {
        id: id
    }
    Client.new.post('/api/v1/planner/run', body)
end