Class: SauceWhisk::Job
- Inherits:
-
Object
- Object
- SauceWhisk::Job
- Defined in:
- lib/sauce_whisk/jobs.rb
Instance Attribute Summary collapse
-
#browser ⇒ Object
readonly
Returns the value of attribute browser.
-
#browser_version ⇒ Object
readonly
Returns the value of attribute browser_version.
-
#creation_time ⇒ Object
readonly
Returns the value of attribute creation_time.
-
#end_time ⇒ Object
readonly
Returns the value of attribute end_time.
-
#error ⇒ Object
readonly
Returns the value of attribute error.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#log_url ⇒ Object
readonly
Returns the value of attribute log_url.
-
#os ⇒ Object
readonly
Returns the value of attribute os.
-
#owner ⇒ Object
readonly
Returns the value of attribute owner.
-
#screenshot_urls ⇒ Object
readonly
Returns the value of attribute screenshot_urls.
-
#start_time ⇒ Object
readonly
Returns the value of attribute start_time.
- #updated_fields ⇒ Object
-
#video_url ⇒ Object
readonly
Returns the value of attribute video_url.
Class Method Summary collapse
Instance Method Summary collapse
- #delete ⇒ Object
- #has_all_asset_names? ⇒ Boolean
-
#initialize(parameters = {}) ⇒ Job
constructor
A new instance of Job.
- #save ⇒ Object
- #screenshots ⇒ Object
- #stop ⇒ Object
- #video ⇒ Object
Constructor Details
#initialize(parameters = {}) ⇒ Job
Returns a new instance of Job.
112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 |
# File 'lib/sauce_whisk/jobs.rb', line 112 def initialize(parameters={}) passed = parameters.delete "status" cd = parameters.delete "custom-data" visibility = parameters.delete "public" self.passed = passed self.custom_data = cd self.visibility = visibility parameters.each do |k,v| self.instance_variable_set("@#{k}".to_sym, v) end @updated_fields = [] end |
Instance Attribute Details
#browser ⇒ Object (readonly)
Returns the value of attribute browser.
106 107 108 |
# File 'lib/sauce_whisk/jobs.rb', line 106 def browser @browser end |
#browser_version ⇒ Object (readonly)
Returns the value of attribute browser_version.
106 107 108 |
# File 'lib/sauce_whisk/jobs.rb', line 106 def browser_version @browser_version end |
#creation_time ⇒ Object (readonly)
Returns the value of attribute creation_time.
107 108 109 |
# File 'lib/sauce_whisk/jobs.rb', line 107 def creation_time @creation_time end |
#end_time ⇒ Object (readonly)
Returns the value of attribute end_time.
107 108 109 |
# File 'lib/sauce_whisk/jobs.rb', line 107 def end_time @end_time end |
#error ⇒ Object (readonly)
Returns the value of attribute error.
107 108 109 |
# File 'lib/sauce_whisk/jobs.rb', line 107 def error @error end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
106 107 108 |
# File 'lib/sauce_whisk/jobs.rb', line 106 def id @id end |
#log_url ⇒ Object (readonly)
Returns the value of attribute log_url.
106 107 108 |
# File 'lib/sauce_whisk/jobs.rb', line 106 def log_url @log_url end |
#os ⇒ Object (readonly)
Returns the value of attribute os.
106 107 108 |
# File 'lib/sauce_whisk/jobs.rb', line 106 def os @os end |
#owner ⇒ Object (readonly)
Returns the value of attribute owner.
106 107 108 |
# File 'lib/sauce_whisk/jobs.rb', line 106 def owner @owner end |
#screenshot_urls ⇒ Object (readonly)
Returns the value of attribute screenshot_urls.
108 109 110 |
# File 'lib/sauce_whisk/jobs.rb', line 108 def screenshot_urls @screenshot_urls end |
#start_time ⇒ Object (readonly)
Returns the value of attribute start_time.
107 108 109 |
# File 'lib/sauce_whisk/jobs.rb', line 107 def start_time @start_time end |
#updated_fields ⇒ Object
144 145 146 |
# File 'lib/sauce_whisk/jobs.rb', line 144 def updated_fields @updated_fields ||= [] end |
#video_url ⇒ Object (readonly)
Returns the value of attribute video_url.
107 108 109 |
# File 'lib/sauce_whisk/jobs.rb', line 107 def video_url @video_url end |
Class Method Details
.tracked_attr_accessor(*methods) ⇒ Object
94 95 96 97 98 99 100 101 102 103 104 |
# File 'lib/sauce_whisk/jobs.rb', line 94 def self.tracked_attr_accessor(*methods) methods.each do |method| attr_reader method self.send(:define_method, "#{method}=") do |arg| if method != arg updated_fields << method instance_variable_set("@#{method}", arg) end end end end |
Instance Method Details
#delete ⇒ Object
136 137 138 |
# File 'lib/sauce_whisk/jobs.rb', line 136 def delete Jobs.delete_job id end |
#has_all_asset_names? ⇒ Boolean
140 141 142 |
# File 'lib/sauce_whisk/jobs.rb', line 140 def has_all_asset_names? !screenshot_urls.nil? end |