Class: JiraCommand::Jira::Project

Inherits:
Base
  • Object
show all
Defined in:
lib/jira_command/jira/project.rb

Constant Summary collapse

BASE_PATH =
'rest/api/2/project'.freeze

Instance Attribute Summary

Attributes inherited from Base

#config, #conn

Instance Method Summary collapse

Methods inherited from Base

#initialize

Constructor Details

This class inherits a constructor from JiraCommand::Jira::Base

Instance Method Details

#listObject



11
12
13
14
15
16
# File 'lib/jira_command/jira/project.rb', line 11

def list
  res = @conn.get(BASE_PATH)
  body = JSON.parse(res.body)

  body.map { |item| { name: item['name'], id: item['id'], key: item['key'] } }
end