lib/sendgrid4r/rest/settings/enforced_tls.rb in sendgrid4r-0.2.0 vs lib/sendgrid4r/rest/settings/enforced_tls.rb in sendgrid4r-0.3.0

- old
+ new

@@ -12,25 +12,32 @@ module EnforcedTls include SendGrid4r::REST::Request EnforcedTls = Struct.new(:require_tls, :require_valid_cert) def self.create_enforced_tls(resp) + return resp if resp.nil? EnforcedTls.new(resp['require_tls'], resp['require_valid_cert']) end - def get_enforced_tls + def self.url + "#{SendGrid4r::Client::BASE_URL}/user/settings/enforced_tls" + end + + def get_enforced_tls(&block) resp = get( @auth, - "#{SendGrid4r::Client::BASE_URL}/user/settings/enforced_tls" + SendGrid4r::REST::Settings::EnforcedTls.url, + &block ) SendGrid4r::REST::Settings::EnforcedTls.create_enforced_tls(resp) end - def patch_enforced_tls(params) + def patch_enforced_tls(params, &block) resp = patch( @auth, - "#{SendGrid4r::Client::BASE_URL}/user/settings/enforced_tls", - params.to_h + SendGrid4r::REST::Settings::EnforcedTls.url, + params.to_h, + &block ) SendGrid4r::REST::Settings::EnforcedTls.create_enforced_tls(resp) end end end