Class: Mailersend::InboundRouting

Inherits:
Object
  • Object
show all
Defined in:
lib/mailersend/inbound_routing/inbound_routing.rb

Overview

Inbound routing endpoint from MailerSend API.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(client = Mailersend::Client.new) ⇒ InboundRouting

Returns a new instance of InboundRouting.



13
14
15
16
17
18
19
20
# File 'lib/mailersend/inbound_routing/inbound_routing.rb', line 13

def initialize(client = Mailersend::Client.new)
  @client = client
  @domain_id = domain_id
  @page = page
  @limit = limit
  @inbound_id = inbound_id
  @settings = []
end

Instance Attribute Details

#clientObject

Returns the value of attribute client.



6
7
8
# File 'lib/mailersend/inbound_routing/inbound_routing.rb', line 6

def client
  @client
end

#domain_idObject

Returns the value of attribute domain_id.



6
7
8
# File 'lib/mailersend/inbound_routing/inbound_routing.rb', line 6

def domain_id
  @domain_id
end

#inbound_idObject

Returns the value of attribute inbound_id.



6
7
8
# File 'lib/mailersend/inbound_routing/inbound_routing.rb', line 6

def inbound_id
  @inbound_id
end

#limitObject

Returns the value of attribute limit.



6
7
8
# File 'lib/mailersend/inbound_routing/inbound_routing.rb', line 6

def limit
  @limit
end

#pageObject

Returns the value of attribute page.



6
7
8
# File 'lib/mailersend/inbound_routing/inbound_routing.rb', line 6

def page
  @page
end

#settingsObject

Returns the value of attribute settings.



6
7
8
# File 'lib/mailersend/inbound_routing/inbound_routing.rb', line 6

def settings
  @settings
end

Instance Method Details

#add_inbound_routeObject



30
31
32
# File 'lib/mailersend/inbound_routing/inbound_routing.rb', line 30

def add_inbound_route
  client.http.post("#{MAILERSEND_API_URL}/inbound", json: @settings)
end

#delete_route(inbound_id:) ⇒ Object



38
39
40
# File 'lib/mailersend/inbound_routing/inbound_routing.rb', line 38

def delete_route(inbound_id:)
  client.http.delete("#{MAILERSEND_API_URL}/inbound/#{inbound_id}")
end

#get_inbound_routesObject



22
23
24
# File 'lib/mailersend/inbound_routing/inbound_routing.rb', line 22

def get_inbound_routes(*)
  client.http.get("#{MAILERSEND_API_URL}/inbound")
end

#get_single_route(inbound_id:) ⇒ Object



26
27
28
# File 'lib/mailersend/inbound_routing/inbound_routing.rb', line 26

def get_single_route(inbound_id:)
  client.http.get("#{MAILERSEND_API_URL}/inbound/#{inbound_id}")
end

#update_inbound_route(inbound_id:) ⇒ Object



34
35
36
# File 'lib/mailersend/inbound_routing/inbound_routing.rb', line 34

def update_inbound_route(inbound_id:)
  client.http.put("#{MAILERSEND_API_URL}/inbound/#{inbound_id}", json: @settings)
end