Class: Nuker::Commands::AddProject
- Defined in:
- lib/nuker/commands/add_project.rb
Instance Attribute Summary collapse
-
#project ⇒ Object
Returns the value of attribute project.
Instance Method Summary collapse
- #execute ⇒ Object
-
#initialize(project) ⇒ AddProject
constructor
A new instance of AddProject.
Methods inherited from Base
Constructor Details
#initialize(project) ⇒ AddProject
Returns a new instance of AddProject.
8 9 10 |
# File 'lib/nuker/commands/add_project.rb', line 8 def initialize(project) @project = project end |
Instance Attribute Details
#project ⇒ Object
Returns the value of attribute project.
6 7 8 |
# File 'lib/nuker/commands/add_project.rb', line 6 def project @project end |
Instance Method Details
#execute ⇒ Object
12 13 14 15 16 |
# File 'lib/nuker/commands/add_project.rb', line 12 def execute response = resource.post("/projects/#{project}") rescue RestClient::Conflict raise ClientError, "Project \"#{project}\" already exists" end |