class RDStation::Emails
Public Class Methods
new(authorization:)
click to toggle source
# File lib/rdstation/emails.rb, line 8 def initialize(authorization:) @authorization = authorization end
Public Instance Methods
all(query_params={})
click to toggle source
# File lib/rdstation/emails.rb, line 12 def all(query_params={}) retryable_request(@authorization) do |authorization| response = self.class.get(base_url, headers: authorization.headers, query: query_params) ApiResponse.build(response) end end
by_id(id)
click to toggle source
# File lib/rdstation/emails.rb, line 19 def by_id(id) retryable_request(@authorization) do |authorization| response = self.class.get(base_url(id), headers: authorization.headers) ApiResponse.build(response) end end
Private Instance Methods
base_url(path='')
click to toggle source
# File lib/rdstation/emails.rb, line 28 def base_url(path='') "#{RDStation.host}/platform/emails/#{path}" end