Class: SendGrid::SpamCheck

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

Instance Method Summary collapse

Constructor Details

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


238
239
240
241
242
# File 'lib/sendgrid/helpers/mail/mail.rb', line 238

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

Instance Method Details

#enableObject


248
249
250
# File 'lib/sendgrid/helpers/mail/mail.rb', line 248

def enable
  @enable
end

#enable=(enable) ⇒ Object


244
245
246
# File 'lib/sendgrid/helpers/mail/mail.rb', line 244

def enable=(enable)
  @enable = enable
end

#post_to_urlObject


264
265
266
# File 'lib/sendgrid/helpers/mail/mail.rb', line 264

def post_to_url
  @post_to_url
end

#post_to_url=(post_to_url) ⇒ Object


260
261
262
# File 'lib/sendgrid/helpers/mail/mail.rb', line 260

def post_to_url=(post_to_url)
  @post_to_url = post_to_url
end

#thresholdObject


256
257
258
# File 'lib/sendgrid/helpers/mail/mail.rb', line 256

def threshold
  @threshold
end

#threshold=(threshold) ⇒ Object


252
253
254
# File 'lib/sendgrid/helpers/mail/mail.rb', line 252

def threshold=(threshold)
  @threshold = threshold
end

#to_jsonObject


268
269
270
271
272
273
274
# File 'lib/sendgrid/helpers/mail/mail.rb', line 268

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