Class: Openlayer::ProjectVersion
- Defined in:
- lib/openlayer/objects/project_version.rb
Instance Attribute Summary collapse
-
#all_attributes_hash ⇒ Object
readonly
Returns the value of attribute all_attributes_hash.
-
#client ⇒ Object
readonly
Returns the value of attribute client.
-
#project_version_id ⇒ Object
readonly
Returns the value of attribute project_version_id.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(client, attributes) ⇒ ProjectVersion
constructor
A new instance of ProjectVersion.
- #print_status_report ⇒ Object
- #print_test_report ⇒ Object
- #refresh ⇒ Object
- #to_h ⇒ Object
- #wait_for_completion(timeout: 300, interval: 10) ⇒ Object
Methods inherited from Object
#method_missing, #respond_to_missing?
Constructor Details
#initialize(client, attributes) ⇒ ProjectVersion
Returns a new instance of ProjectVersion.
12 13 14 15 16 |
# File 'lib/openlayer/objects/project_version.rb', line 12 def initialize(client, attributes) @client = client super(attributes) @project_version_id = commit.projectVersionId end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class Openlayer::Object
Instance Attribute Details
#all_attributes_hash ⇒ Object (readonly)
Returns the value of attribute all_attributes_hash.
5 6 7 |
# File 'lib/openlayer/objects/project_version.rb', line 5 def all_attributes_hash @all_attributes_hash end |
#client ⇒ Object (readonly)
Returns the value of attribute client.
5 6 7 |
# File 'lib/openlayer/objects/project_version.rb', line 5 def client @client end |
#project_version_id ⇒ Object (readonly)
Returns the value of attribute project_version_id.
5 6 7 |
# File 'lib/openlayer/objects/project_version.rb', line 5 def project_version_id @project_version_id end |
Class Method Details
.from_response(client, response) ⇒ Object
7 8 9 10 |
# File 'lib/openlayer/objects/project_version.rb', line 7 def self.from_response(client, response) attributes = handle_response(response) new(client, attributes) end |
Instance Method Details
#print_status_report ⇒ Object
18 19 20 21 |
# File 'lib/openlayer/objects/project_version.rb', line 18 def print_status_report puts "Status: #{status}" puts "Status Message: #{}" unless .nil? end |
#print_test_report ⇒ Object
23 24 25 26 27 |
# File 'lib/openlayer/objects/project_version.rb', line 23 def print_test_report puts "Failing Test Count: #{failing_test_count}" puts "Passing Test Count: #{passing_test_count}" puts "Total Test Count: #{total_test_count}" end |
#refresh ⇒ Object
43 44 45 |
# File 'lib/openlayer/objects/project_version.rb', line 43 def refresh @attributes = OpenStruct.new handle_response client.connection.get("versions/#{project_version_id}") end |
#to_h ⇒ Object
29 30 31 |
# File 'lib/openlayer/objects/project_version.rb', line 29 def to_h @attributes.to_h end |
#wait_for_completion(timeout: 300, interval: 10) ⇒ Object
33 34 35 36 37 38 39 40 41 |
# File 'lib/openlayer/objects/project_version.rb', line 33 def wait_for_completion(timeout: 300, interval: 10) start_time = Time.now while Time.now - start_time < timeout refresh break if status == "completed" || status == "failed" sleep interval end end |