Class: Blastengine::Job
- Includes:
- Blastengine
- Defined in:
- lib/blastengine/job.rb
Constant Summary
Constants included from Blastengine
Instance Attribute Summary collapse
-
#error_file_url ⇒ Object
Returns the value of attribute error_file_url.
-
#failed_count ⇒ Object
Returns the value of attribute failed_count.
-
#job_id ⇒ Object
Returns the value of attribute job_id.
-
#percentage ⇒ Object
Returns the value of attribute percentage.
-
#status ⇒ Object
Returns the value of attribute status.
-
#success_count ⇒ Object
Returns the value of attribute success_count.
-
#total_count ⇒ Object
Returns the value of attribute total_count.
Attributes inherited from Base
#created_time, #delivery_id, #delivery_time, #delivery_type, #drop_count, #hard_error_count, #open_count, #sent_count, #soft_error_count, #updated_time
Instance Method Summary collapse
- #error_message ⇒ Object
- #finish? ⇒ Boolean
-
#initialize(id) ⇒ Job
constructor
A new instance of Job.
Methods included from Blastengine
Methods inherited from Download
Methods inherited from Base
#cancel, #client, client, #delete, #get, #set, #sets, #unsubscribe
Constructor Details
#initialize(id) ⇒ Job
Returns a new instance of Job.
7 8 9 |
# File 'lib/blastengine/job.rb', line 7 def initialize id @job_id = id end |
Instance Attribute Details
#error_file_url ⇒ Object
Returns the value of attribute error_file_url.
6 7 8 |
# File 'lib/blastengine/job.rb', line 6 def error_file_url @error_file_url end |
#failed_count ⇒ Object
Returns the value of attribute failed_count.
6 7 8 |
# File 'lib/blastengine/job.rb', line 6 def failed_count @failed_count end |
#job_id ⇒ Object
Returns the value of attribute job_id.
6 7 8 |
# File 'lib/blastengine/job.rb', line 6 def job_id @job_id end |
#percentage ⇒ Object
Returns the value of attribute percentage.
6 7 8 |
# File 'lib/blastengine/job.rb', line 6 def percentage @percentage end |
#status ⇒ Object
Returns the value of attribute status.
6 7 8 |
# File 'lib/blastengine/job.rb', line 6 def status @status end |
#success_count ⇒ Object
Returns the value of attribute success_count.
6 7 8 |
# File 'lib/blastengine/job.rb', line 6 def success_count @success_count end |
#total_count ⇒ Object
Returns the value of attribute total_count.
6 7 8 |
# File 'lib/blastengine/job.rb', line 6 def total_count @total_count end |
Instance Method Details
#error_message ⇒ Object
24 25 26 27 28 29 30 31 |
# File 'lib/blastengine/job.rb', line 24 def return unless .nil? return nil if @error_file_url.nil? path = "/deliveries/-/emails/import/#{@job_id}/errorinfo/download" res = @@client.get path, true = download res end |
#finish? ⇒ Boolean
11 12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/blastengine/job.rb', line 11 def finish? # APIリクエスト用のパス path = "/deliveries/-/emails/import/#{@job_id}" res = @@client.get path @percentage = res["percentage"] @status = res["status"] @error_file_url = res["error_file_url"] unless res["error_file_url"].nil? @success_count = res["success_count"] unless res["success_count"].nil? @failed_count = res["failed_count"] unless res["failed_count"].nil? @total_count = res["total_count"] unless res["total_count"].nil? return @percentage == 100 end |