Sha256: dc5ae152269ed307067891d39336afa41b996e12562adc1c66b01a7435655cb9
Contents?: true
Size: 906 Bytes
Versions: 11
Compression:
Stored size: 906 Bytes
Contents
# frozen_string_literal: true module Shark module DoubleOptIn class Request < Base extend DoubleOptIn::Resource ATTRIBUTES = %w[ payload request_type recipient subject header sub_header message verification_url verification_link_text message_footer_html timeout leeway_to_terminate max_verifications ].freeze attr_accessor(*ATTRIBUTES) def self.create(attributes) body = { data: { type: 'requests', attributes: attributes } } response = connection.request(:post, '/requests/', body: body) new(response.body['data']) end def initialize(data) ATTRIBUTES.each do |key| public_send("#{key}=", data['attributes'][key]) end end end end end
Version data entries
11 entries across 11 versions & 1 rubygems