Sha256: 02bede6ab375d459446579dbf0d292b27fb33625e4b14bcd491db33856c5caee

Contents?: true

Size: 396 Bytes

Versions: 10

Compression:

Stored size: 396 Bytes

Contents

module Notifications
  class Client
    class TemplatePreview
      FIELDS = %i(
        id
        version
        body
        subject
        type
        html
      ).freeze

      attr_reader(*FIELDS)

      def initialize(notification)
        FIELDS.each do |field|
          instance_variable_set(:"@#{field}", notification.fetch(field.to_s, nil))
        end
      end
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
notifications-ruby-client-6.2.0 lib/notifications/client/template_preview.rb
notifications-ruby-client-6.0.0 lib/notifications/client/template_preview.rb
notifications-ruby-client-5.4.0 lib/notifications/client/template_preview.rb
notifications-ruby-client-5.3.0 lib/notifications/client/template_preview.rb
notifications-ruby-client-5.2.0 lib/notifications/client/template_preview.rb
notifications-ruby-client-5.1.2 lib/notifications/client/template_preview.rb
notifications-ruby-client-5.1.1 lib/notifications/client/template_preview.rb
notifications-ruby-client-5.1.0 lib/notifications/client/template_preview.rb
notifications-ruby-client-4.0.0 lib/notifications/client/template_preview.rb
notifications-ruby-client-3.1.0 lib/notifications/client/template_preview.rb