Class: SendGrid::SpamCheck

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(enable: nil, threshold: nil, post_to_url: nil) ⇒ SpamCheck

Returns a new instance of SpamCheck.


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

def initialize(enable: nil, threshold: nil, post_to_url: nil)
  @enable = enable
  @threshold = threshold
  @post_to_url = post_to_url
end

Instance Attribute Details

#enableObject

Returns the value of attribute enable


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

def enable
  @enable
end

#post_to_urlObject

Returns the value of attribute post_to_url


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

def post_to_url
  @post_to_url
end

#thresholdObject

Returns the value of attribute threshold


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

def threshold
  @threshold
end

Instance Method Details

#to_jsonObject


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

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