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