Class: Metaforce::Job::Deploy
- Inherits:
-
Metaforce::Job
- Object
- Metaforce::Job
- Metaforce::Job::Deploy
- Defined in:
- lib/metaforce/job/deploy.rb
Constant Summary
Constants inherited from Metaforce::Job
Instance Attribute Summary
Attributes inherited from Metaforce::Job
Instance Method Summary collapse
-
#initialize(client, path, options = {}) ⇒ Deploy
constructor
Public: Instantiate a new deploy job.
-
#perform ⇒ Object
Public: Perform the job.
-
#result ⇒ Object
Public: Get the detailed status of the deploy.
-
#success? ⇒ Boolean
Public: Returns true if the deploy was successful.
Methods inherited from Metaforce::Job
disable_threading!, #done?, #inspect, #started?, #state, #status
Constructor Details
#initialize(client, path, options = {}) ⇒ Deploy
Public: Instantiate a new deploy job.
Examples
job = Metaforce::Job::Deploy.new(client, './path/to/deploy')
# => #<Metaforce::Job::Deploy @id=nil>
Returns self.
12 13 14 15 |
# File 'lib/metaforce/job/deploy.rb', line 12 def initialize(client, path, ={}) super(client) @path, = path, end |
Instance Method Details
#perform ⇒ Object
Public: Perform the job.
Examples
job = Metaforce::Job::Deploy.new(client, './path/to/deploy')
job.perform
# => #<Metaforce::Job::Deploy @id='1234'>
Returns self.
26 27 28 29 |
# File 'lib/metaforce/job/deploy.rb', line 26 def perform @id = client._deploy(payload, ).id super end |
#result ⇒ Object
Public: Get the detailed status of the deploy.
Examples
job.result
# => { :id => '1234', :success => true, ... }
Returns the DeployResult (www.salesforce.com/us/developer/docs/api_meta/Content/meta_deployresult.htm).
39 40 41 |
# File 'lib/metaforce/job/deploy.rb', line 39 def result @result ||= client.status(id, :deploy) end |
#success? ⇒ Boolean
Public: Returns true if the deploy was successful.
Examples
job.success?
# => true
Returns true or false based on the DeployResult.
51 52 53 |
# File 'lib/metaforce/job/deploy.rb', line 51 def success? result.success end |