Class: Legion::CLI::CodegenCommand

Inherits:
Thor
  • Object
show all
Defined in:
lib/legion/cli/codegen_command.rb

Instance Method Summary collapse

Instance Method Details

#approve(id) ⇒ Object



35
36
37
38
# File 'lib/legion/cli/codegen_command.rb', line 35

def approve(id)
  data = api_post("/api/codegen/generated/#{id}/approve")
  formatter.json(data)
end

#cycleObject



60
61
62
63
# File 'lib/legion/cli/codegen_command.rb', line 60

def cycle
  data = api_post('/api/codegen/cycle')
  formatter.json(data)
end

#gapsObject



54
55
56
57
# File 'lib/legion/cli/codegen_command.rb', line 54

def gaps
  data = api_get('/api/codegen/gaps')
  formatter.json(data)
end

#listObject



21
22
23
24
25
26
# File 'lib/legion/cli/codegen_command.rb', line 21

def list
  path = '/api/codegen/generated'
  path += "?status=#{options[:status]}" if options[:status]
  data = api_get(path)
  formatter.json(data)
end

#reject(id) ⇒ Object



41
42
43
44
# File 'lib/legion/cli/codegen_command.rb', line 41

def reject(id)
  data = api_post("/api/codegen/generated/#{id}/reject")
  formatter.json(data)
end

#retry_generation(id) ⇒ Object



47
48
49
50
# File 'lib/legion/cli/codegen_command.rb', line 47

def retry_generation(id)
  data = api_post("/api/codegen/generated/#{id}/retry")
  formatter.json(data)
end

#show(id) ⇒ Object



29
30
31
32
# File 'lib/legion/cli/codegen_command.rb', line 29

def show(id)
  data = api_get("/api/codegen/generated/#{id}")
  formatter.json(data)
end

#statusObject



14
15
16
17
# File 'lib/legion/cli/codegen_command.rb', line 14

def status
  data = api_get('/api/codegen/status')
  formatter.json(data)
end