Sha256: e457d2201219f9e314b113ed01afb5a19c6030382c60e1b99d3b10b09db80c45

Contents?: true

Size: 1.4 KB

Versions: 11

Compression:

Stored size: 1.4 KB

Contents

require 'json'

module SendGrid
  class Ganalytics
    def initialize(enable: nil, utm_source: nil, utm_medium: nil, utm_term: nil, utm_content: nil, utm_campaign: nil, utm_name: nil)
      @enable = enable
      @utm_source = utm_source
      @utm_medium = utm_medium
      @utm_term = utm_term
      @utm_content = utm_content
      @utm_campaign = utm_campaign
      @utm_name = utm_name
    end

    def enable=(enable)
      @enable = enable
    end

    def enable
      @enable
    end

    def utm_source=(utm_source)
      @utm_source = utm_source
    end

    def utm_source
      @utm_source
    end

    def utm_medium=(utm_medium)
      @utm_medium = utm_medium
    end

    def utm_medium
      @utm_medium
    end

    def utm_term=(utm_term)
      @utm_term = utm_term
    end

    def utm_term
      @utm_term
    end

    def utm_content=(utm_content)
      @utm_content = utm_content
    end

    def utm_content
      @utm_content
    end

    def utm_campaign=(utm_campaign)
      @utm_campaign = utm_campaign
    end

    def utm_campaign
      @utm_campaign
    end

    def to_json(*)
      {
        'enable' => self.enable,
        'utm_source' => self.utm_source,
        'utm_medium' => self.utm_medium,
        'utm_term' => self.utm_term,
        'utm_content' => self.utm_content,
        'utm_campaign' => self.utm_campaign
      }.delete_if { |_, value| value.to_s.strip == '' }
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
sendgrid-ruby-6.1.1 lib/sendgrid/helpers/mail/ganalytics.rb
sendgrid-ruby-6.1.0 lib/sendgrid/helpers/mail/ganalytics.rb
sendgrid-ruby-6.0.4 lib/sendgrid/helpers/mail/ganalytics.rb
sendgrid-ruby-6.0.3 lib/sendgrid/helpers/mail/ganalytics.rb
sendgrid-ruby-6.0.2 lib/sendgrid/helpers/mail/ganalytics.rb
sendgrid-ruby-6.0.1 lib/sendgrid/helpers/mail/ganalytics.rb
sendgrid-ruby-6.0.0 lib/sendgrid/helpers/mail/ganalytics.rb
sendgrid-ruby-5.3.0 lib/sendgrid/helpers/mail/ganalytics.rb
sendgrid-ruby-5.2.0 lib/sendgrid/helpers/mail/ganalytics.rb
sendgrid-ruby-5.1.0 lib/sendgrid/helpers/mail/ganalytics.rb
sendgrid-ruby-5.0.0 lib/sendgrid/helpers/mail/ganalytics.rb