Class: SendGrid::IpManagement

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(sendgrid_client:) ⇒ IpManagement

Returns a new instance of IpManagement.



7
8
9
# File 'lib/sendgrid/helpers/ip_management/ip_management.rb', line 7

def initialize(sendgrid_client:)
  @sendgrid_client = sendgrid_client
end

Instance Attribute Details

#sendgrid_clientObject

Returns the value of attribute sendgrid_client.



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

def sendgrid_client
  @sendgrid_client
end

Instance Method Details

#unassignedObject



11
12
13
14
15
# File 'lib/sendgrid/helpers/ip_management/ip_management.rb', line 11

def unassigned
  response = @sendgrid_client.ips.get
  ips = JSON.parse(response.body)
  ips.select { |ip| ip.subusers.empty? }
end