Class: RevisioneerRails::Deployment
- Inherits:
-
Struct
- Object
- Struct
- RevisioneerRails::Deployment
- Defined in:
- lib/revisioneer_rails/deployment.rb
Instance Attribute Summary collapse
-
#deployed_at ⇒ Object
Returns the value of attribute deployed_at.
-
#messages ⇒ Object
Returns the value of attribute messages.
-
#sha ⇒ Object
Returns the value of attribute sha.
Class Method Summary collapse
Instance Attribute Details
#deployed_at ⇒ Object
Returns the value of attribute deployed_at
5 6 7 |
# File 'lib/revisioneer_rails/deployment.rb', line 5 def deployed_at @deployed_at end |
#messages ⇒ Object
Returns the value of attribute messages
5 6 7 |
# File 'lib/revisioneer_rails/deployment.rb', line 5 def @messages end |
#sha ⇒ Object
Returns the value of attribute sha
5 6 7 |
# File 'lib/revisioneer_rails/deployment.rb', line 5 def sha @sha end |
Class Method Details
.load(page = 1, limit = 20) ⇒ Object
6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
# File 'lib/revisioneer_rails/deployment.rb', line 6 def self.load page = 1, limit = 20 url = ::RevisioneerRails.config.url + "/deployments" request = Typhoeus::Request.new( url, method: :get, headers: { "API-TOKEN" => ::RevisioneerRails.config.api_token } ) response = request.run json = ::JSON.parse response.body json.map { |deploy_data| self.new(deploy_data["sha"], Time.parse(deploy_data["deployed_at"]), deploy_data["messages"]) } end |