Class: Deploy::Deployment

Inherits:
Base
  • Object
show all
Defined in:
lib/deploy/deployment.rb

Instance Attribute Summary

Attributes inherited from Base

#attributes, #errors, #id

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Base

class_name, #create, #destroy, find, find_all, find_single, #method_missing, #new_record?, #post, post, #save, #update

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Deploy::Base

Class Method Details

.collection_path(params = {}) ⇒ Object



5
6
7
# File 'lib/deploy/deployment.rb', line 5

def collection_path(params = {})
  "projects/#{params[:project].permalink}/deployments"
end

.member_path(id, params = {}) ⇒ Object



9
10
11
# File 'lib/deploy/deployment.rb', line 9

def member_path(id, params = {})
  "projects/#{params[:project].permalink}/deployments/#{id}"
end

Instance Method Details

#default_paramsObject



14
15
16
# File 'lib/deploy/deployment.rb', line 14

def default_params
  {:project => self.project}
end

#projectObject



18
19
20
21
22
23
# File 'lib/deploy/deployment.rb', line 18

def project
  if self.attributes['project'].is_a?(Hash)
    self.attributes['project'] = Project.send(:create_object, self.attributes['project'])
  end
  self.attributes['project']
end

#status_poll(params = {}) ⇒ Object



30
31
32
33
# File 'lib/deploy/deployment.rb', line 30

def status_poll(params = {})
  params = {:deployment => self, :project => self.project}.merge(params)
  DeploymentStatusPoll.poll(params)
end

#taps(params = {}) ⇒ Object



25
26
27
28
# File 'lib/deploy/deployment.rb', line 25

def taps(params={})
  params = {:deployment => self, :project => self.project}.merge(params)
  DeploymentTap.find(:all, params)
end