Class: SendGrid::TrackingSettingsDto

Inherits:
Object
  • Object
show all
Defined in:
lib/sendgrid/helpers/settings/tracking_settings_dto.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Attribute Details

#clickObject (readonly) Also known as: click_tracking

Returns the value of attribute click.



3
4
5
# File 'lib/sendgrid/helpers/settings/tracking_settings_dto.rb', line 3

def click
  @click
end

#google_analyticsObject (readonly)

Returns the value of attribute google_analytics.



3
4
5
# File 'lib/sendgrid/helpers/settings/tracking_settings_dto.rb', line 3

def google_analytics
  @google_analytics
end

#openObject (readonly) Also known as: open_tracking

Returns the value of attribute open.



3
4
5
# File 'lib/sendgrid/helpers/settings/tracking_settings_dto.rb', line 3

def open
  @open
end

#subscriptionObject (readonly) Also known as: subscription_tracking

Returns the value of attribute subscription.



3
4
5
# File 'lib/sendgrid/helpers/settings/tracking_settings_dto.rb', line 3

def subscription
  @subscription
end

Class Method Details

.fetch(sendgrid_client:, name:, query_params:) ⇒ Object



8
9
10
11
# File 'lib/sendgrid/helpers/settings/tracking_settings_dto.rb', line 8

def self.fetch(sendgrid_client:, name:, query_params:)
  name = scrub_alias_names(name.to_s)
  sendgrid_client.tracking_settings.public_send(name).get(query_params: query_params)
end

.scrub_alias_names(name) ⇒ Object



18
19
20
# File 'lib/sendgrid/helpers/settings/tracking_settings_dto.rb', line 18

def self.scrub_alias_names(name)
  name.gsub(/_tracking/, '')
end

.update(sendgrid_client:, name:, request_body:) ⇒ Object



13
14
15
16
# File 'lib/sendgrid/helpers/settings/tracking_settings_dto.rb', line 13

def self.update(sendgrid_client:, name:, request_body:)
  name = scrub_alias_names(name.to_s)
  sendgrid_client.tracking_settings.public_send(name).patch(request_body: request_body)
end