Class: SendGrid::Footer

Inherits:
Object
  • Object
show all
Defined in:
lib/sendgrid/helpers/mail/footer.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(enable: nil, text: nil, html: nil) ⇒ Footer

Returns a new instance of Footer.


7
8
9
10
11
# File 'lib/sendgrid/helpers/mail/footer.rb', line 7

def initialize(enable: nil, text: nil, html: nil)
  @enable = enable
  @text = text
  @html = html
end

Instance Attribute Details

#enableObject

Returns the value of attribute enable


5
6
7
# File 'lib/sendgrid/helpers/mail/footer.rb', line 5

def enable
  @enable
end

#htmlObject

Returns the value of attribute html


5
6
7
# File 'lib/sendgrid/helpers/mail/footer.rb', line 5

def html
  @html
end

#textObject

Returns the value of attribute text


5
6
7
# File 'lib/sendgrid/helpers/mail/footer.rb', line 5

def text
  @text
end

Instance Method Details

#to_jsonObject


13
14
15
16
17
18
19
# File 'lib/sendgrid/helpers/mail/footer.rb', line 13

def to_json(*)
  {
    'enable' => enable,
    'text' => text,
    'html' => html
  }.delete_if { |_, value| value.to_s.strip == '' }
end