Class: Deploy::DeploymentStatusPoll
- Inherits:
-
Object
- Object
- Deploy::DeploymentStatusPoll
- Defined in:
- lib/deploy/deployment_status_poll.rb
Instance Attribute Summary collapse
-
#attributes ⇒ Object
Returns the value of attribute attributes.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(parsed_json) ⇒ DeploymentStatusPoll
constructor
A new instance of DeploymentStatusPoll.
- #status ⇒ Object
- #taps ⇒ Object
Constructor Details
#initialize(parsed_json) ⇒ DeploymentStatusPoll
Returns a new instance of DeploymentStatusPoll.
5 6 7 |
# File 'lib/deploy/deployment_status_poll.rb', line 5 def initialize(parsed_json) self.attributes = parsed_json end |
Instance Attribute Details
#attributes ⇒ Object
Returns the value of attribute attributes.
3 4 5 |
# File 'lib/deploy/deployment_status_poll.rb', line 3 def attributes @attributes end |
Class Method Details
.poll(params = {}) ⇒ Object
26 27 28 29 30 31 |
# File 'lib/deploy/deployment_status_poll.rb', line 26 def poll(params = {}) req = Request.new(poll_url(params)).make parsed = JSON.parse(req.output) new(parsed) end |
.poll_url(params) ⇒ Object
19 20 21 22 23 24 |
# File 'lib/deploy/deployment_status_poll.rb', line 19 def poll_url(params) base = "projects/#{params[:project].permalink}/deployments/#{params[:deployment].identifier}/logs/poll" base += "?status=#{params[:status]}" base += "&since=#{params[:since]}" if params[:since] base end |
Instance Method Details
#status ⇒ Object
9 10 11 |
# File 'lib/deploy/deployment_status_poll.rb', line 9 def status @status ||= attributes['status'] end |
#taps ⇒ Object
13 14 15 16 |
# File 'lib/deploy/deployment_status_poll.rb', line 13 def taps return [] unless attributes['taps'] @taps ||= attributes['taps'].map { |t| DeploymentTap.send(:create_object, t) } end |