Sha256: 6da50980ea0378f7925edf081a1be5417daa899f0c7cb683b5d3ac26a127a6ed

Contents?: true

Size: 383 Bytes

Versions: 11

Compression:

Stored size: 383 Bytes

Contents

module Notifications
  class Client
    class TemplatePreview
      FIELDS = %i(
        id
        version
        body
        subject
        type
      ).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

11 entries across 11 versions & 1 rubygems

Version Path
notifications-ruby-client-3.0.0 lib/notifications/client/template_preview.rb
notifications-ruby-client-2.10.0 lib/notifications/client/template_preview.rb
notifications-ruby-client-2.9.0 lib/notifications/client/template_preview.rb
notifications-ruby-client-2.8.0 lib/notifications/client/template_preview.rb
notifications-ruby-client-2.7.0 lib/notifications/client/template_preview.rb
notifications-ruby-client-2.6.0 lib/notifications/client/template_preview.rb
notifications-ruby-client-2.5.1 lib/notifications/client/template_preview.rb
notifications-ruby-client-2.5.0 lib/notifications/client/template_preview.rb
notifications-ruby-client-2.4.0 lib/notifications/client/template_preview.rb
notifications-ruby-client-2.3.0 lib/notifications/client/template_preview.rb
notifications-ruby-client-2.2.0 lib/notifications/client/template_preview.rb