Class: Mailersend::InboundRouting
- Inherits:
-
Object
- Object
- Mailersend::InboundRouting
- Defined in:
- lib/mailersend/inbound_routing/inbound_routing.rb
Overview
Inbound routing endpoint from MailerSend API.
Instance Attribute Summary collapse
-
#client ⇒ Object
Returns the value of attribute client.
-
#domain_id ⇒ Object
Returns the value of attribute domain_id.
-
#inbound_id ⇒ Object
Returns the value of attribute inbound_id.
-
#limit ⇒ Object
Returns the value of attribute limit.
-
#page ⇒ Object
Returns the value of attribute page.
-
#settings ⇒ Object
Returns the value of attribute settings.
Instance Method Summary collapse
- #add_inbound_route ⇒ Object
- #delete_route(inbound_id:) ⇒ Object
- #get_inbound_routes ⇒ Object
- #get_single_route(inbound_id:) ⇒ Object
-
#initialize(client = Mailersend::Client.new) ⇒ InboundRouting
constructor
A new instance of InboundRouting.
- #update_inbound_route(inbound_id:) ⇒ Object
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
#client ⇒ Object
Returns the value of attribute client.
6 7 8 |
# File 'lib/mailersend/inbound_routing/inbound_routing.rb', line 6 def client @client end |
#domain_id ⇒ Object
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_id ⇒ Object
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 |
#limit ⇒ Object
Returns the value of attribute limit.
6 7 8 |
# File 'lib/mailersend/inbound_routing/inbound_routing.rb', line 6 def limit @limit end |
#page ⇒ Object
Returns the value of attribute page.
6 7 8 |
# File 'lib/mailersend/inbound_routing/inbound_routing.rb', line 6 def page @page end |
#settings ⇒ Object
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_route ⇒ Object
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_routes ⇒ Object
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 |