Class: SendGrid::ASM

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(group_id: nil, groups_to_display: nil) ⇒ ASM

Returns a new instance of ASM.



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

def initialize(group_id: nil, groups_to_display: nil)
  @group_id = group_id
  @groups_to_display = groups_to_display
end

Instance Attribute Details

#group_idObject

Returns the value of attribute group_id.



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

def group_id
  @group_id
end

#groups_to_displayObject

Returns the value of attribute groups_to_display.



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

def groups_to_display
  @groups_to_display
end

Instance Method Details

#to_jsonObject



12
13
14
15
16
17
# File 'lib/sendgrid/helpers/mail/asm.rb', line 12

def to_json(*)
  {
    'group_id' => group_id,
    'groups_to_display' => groups_to_display
  }.delete_if { |_, value| value.to_s.strip == '' }
end