Sha256: bc3572732c5a9d57d5f0f924cddf7103e732032c5acecc8b3930ca7cae93be38

Contents?: true

Size: 317 Bytes

Versions: 9

Compression:

Stored size: 317 Bytes

Contents

module SendGrid
  class Content

    attr_accessor :type, :value

    def initialize(type: nil, value: nil)
      @type = type
      @value = value
    end

    def to_json(*)
      {
        'type' => self.type,
        'value' => self.value
      }.delete_if { |_, value| value.to_s.strip == '' }
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
sendgrid-ruby-6.3.4 lib/sendgrid/helpers/mail/content.rb
sendgrid-ruby-6.3.3 lib/sendgrid/helpers/mail/content.rb
sendgrid-ruby-6.3.2 lib/sendgrid/helpers/mail/content.rb
sendgrid-ruby-6.3.1 lib/sendgrid/helpers/mail/content.rb
sendgrid-ruby-6.2.1 lib/sendgrid/helpers/mail/content.rb
sendgrid-ruby-6.2.0 lib/sendgrid/helpers/mail/content.rb
sendgrid-ruby-6.1.4 lib/sendgrid/helpers/mail/content.rb
sendgrid-ruby-6.1.3 lib/sendgrid/helpers/mail/content.rb
sendgrid-ruby-6.1.2 lib/sendgrid/helpers/mail/content.rb