Class: SendGrid::CustomArg
- Inherits:
-
Object
- Object
- SendGrid::CustomArg
- Defined in:
- lib/sendgrid/helpers/mail/mail.rb
Instance Method Summary collapse
- #custom_arg ⇒ Object
- #custom_arg=(custom_arg) ⇒ Object
-
#initialize(key: nil, value: nil) ⇒ CustomArg
constructor
A new instance of CustomArg.
- #to_json ⇒ Object
Constructor Details
#initialize(key: nil, value: nil) ⇒ CustomArg
Returns a new instance of CustomArg.
621 622 623 624 |
# File 'lib/sendgrid/helpers/mail/mail.rb', line 621 def initialize(key: nil, value: nil) @custom_arg = {} (key.nil? || value.nil?) ? @custom_arg = nil : @custom_arg[key] = value end |
Instance Method Details
#custom_arg ⇒ Object
630 631 632 |
# File 'lib/sendgrid/helpers/mail/mail.rb', line 630 def custom_arg @custom_arg end |
#custom_arg=(custom_arg) ⇒ Object
626 627 628 |
# File 'lib/sendgrid/helpers/mail/mail.rb', line 626 def custom_arg=(custom_arg) @custom_arg = custom_arg end |
#to_json ⇒ Object
634 635 636 637 638 |
# File 'lib/sendgrid/helpers/mail/mail.rb', line 634 def to_json(*) { 'custom_arg' => self.custom_arg }.delete_if { |_, value| value.to_s.strip == '' } end |