class SendGrid::Header

Attributes

header[RW]

Public Class Methods

new(key: nil, value: nil) click to toggle source
# File lib/sendgrid/helpers/mail/header.rb, line 7
def initialize(key: nil, value: nil)
  @header = {}
  key.nil? || value.nil? ? @header = nil : @header[key] = value
end

Public Instance Methods

to_json(*) click to toggle source
# File lib/sendgrid/helpers/mail/header.rb, line 12
def to_json(*)
  {
    'header' => header
  }.delete_if { |_, value| value.to_s.strip == '' }
end