Class: SendGrid::Metrics

Inherits:
Object
  • Object
show all
Defined in:
lib/sendgrid/helpers/stats/metrics.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(args = {}) ⇒ Metrics

Returns a new instance of Metrics.



9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# File 'lib/sendgrid/helpers/stats/metrics.rb', line 9

def initialize(args = {})
  @date = args['date']
  @blocks = args['blocks']
  @bounce_drops = args['bounce_drops']
  @bounces = args['bounces']
  @clicks = args['clicks']
  @deferred = args['deferred']
  @delivered = args['delivered']
  @invalid_emails = args['invalid_emails']
  @opens = args['opens']
  @processed = args['processed']
  @requests = args['requests']
  @spam_report_drops = args['spam_report_drops']
  @spam_reports = args['spam_reports']
  @unique_clicks = args['unique_clicks']
  @unique_opens = args['unique_opens']
  @unsubscribe_drops = args['unsubscribe_drops']
  @unsubscribes = args['unsubscribes']
end

Instance Attribute Details

#blocksObject (readonly)

Returns the value of attribute blocks.



3
4
5
# File 'lib/sendgrid/helpers/stats/metrics.rb', line 3

def blocks
  @blocks
end

#bounce_dropsObject (readonly)

Returns the value of attribute bounce_drops.



3
4
5
# File 'lib/sendgrid/helpers/stats/metrics.rb', line 3

def bounce_drops
  @bounce_drops
end

#bouncesObject (readonly)

Returns the value of attribute bounces.



3
4
5
# File 'lib/sendgrid/helpers/stats/metrics.rb', line 3

def bounces
  @bounces
end

#clicksObject (readonly)

Returns the value of attribute clicks.



3
4
5
# File 'lib/sendgrid/helpers/stats/metrics.rb', line 3

def clicks
  @clicks
end

#deferredObject (readonly)

Returns the value of attribute deferred.



3
4
5
# File 'lib/sendgrid/helpers/stats/metrics.rb', line 3

def deferred
  @deferred
end

#deliveredObject (readonly)

Returns the value of attribute delivered.



3
4
5
# File 'lib/sendgrid/helpers/stats/metrics.rb', line 3

def delivered
  @delivered
end

#invalid_emailsObject (readonly)

Returns the value of attribute invalid_emails.



3
4
5
# File 'lib/sendgrid/helpers/stats/metrics.rb', line 3

def invalid_emails
  @invalid_emails
end

#opensObject (readonly)

Returns the value of attribute opens.



3
4
5
# File 'lib/sendgrid/helpers/stats/metrics.rb', line 3

def opens
  @opens
end

#processedObject (readonly)

Returns the value of attribute processed.



3
4
5
# File 'lib/sendgrid/helpers/stats/metrics.rb', line 3

def processed
  @processed
end

#requestsObject (readonly)

Returns the value of attribute requests.



3
4
5
# File 'lib/sendgrid/helpers/stats/metrics.rb', line 3

def requests
  @requests
end

#spam_report_dropsObject (readonly)

Returns the value of attribute spam_report_drops.



3
4
5
# File 'lib/sendgrid/helpers/stats/metrics.rb', line 3

def spam_report_drops
  @spam_report_drops
end

#spam_reportsObject (readonly)

Returns the value of attribute spam_reports.



3
4
5
# File 'lib/sendgrid/helpers/stats/metrics.rb', line 3

def spam_reports
  @spam_reports
end

#unique_clicksObject (readonly)

Returns the value of attribute unique_clicks.



3
4
5
# File 'lib/sendgrid/helpers/stats/metrics.rb', line 3

def unique_clicks
  @unique_clicks
end

#unique_opensObject (readonly)

Returns the value of attribute unique_opens.



3
4
5
# File 'lib/sendgrid/helpers/stats/metrics.rb', line 3

def unique_opens
  @unique_opens
end

#unsubscribe_dropsObject (readonly)

Returns the value of attribute unsubscribe_drops.



3
4
5
# File 'lib/sendgrid/helpers/stats/metrics.rb', line 3

def unsubscribe_drops
  @unsubscribe_drops
end

#unsubscribesObject (readonly)

Returns the value of attribute unsubscribes.



3
4
5
# File 'lib/sendgrid/helpers/stats/metrics.rb', line 3

def unsubscribes
  @unsubscribes
end

Instance Method Details

#dateObject



29
30
31
# File 'lib/sendgrid/helpers/stats/metrics.rb', line 29

def date
  Date.parse(@date)
end