Class: Codeship::Projects
- Inherits:
-
Object
- Object
- Codeship::Projects
- Defined in:
- lib/codeship/projects.rb
Instance Method Summary collapse
-
#initialize(api_key = nil) ⇒ Projects
constructor
A new instance of Projects.
- #list ⇒ Object
- #project(id) ⇒ Object
Methods included from Response
Methods included from Request
Constructor Details
#initialize(api_key = nil) ⇒ Projects
Returns a new instance of Projects.
10 11 12 |
# File 'lib/codeship/projects.rb', line 10 def initialize api_key = nil @api_key = api_key end |
Instance Method Details
#list ⇒ Object
14 15 16 17 18 |
# File 'lib/codeship/projects.rb', line 14 def list raise ArgumentError, 'You need to set API key' if !@api_key resp = http_request.request_get projects_url handle(resp)['projects'] end |
#project(id) ⇒ Object
20 21 22 23 24 25 |
# File 'lib/codeship/projects.rb', line 20 def project id raise ArgumentError, 'You need to set API key' if !@api_key @project_id = id resp = http_request.request_get projects_url handle(resp) end |