Sha256: de0da857f393d9c8b2129f870906bd8f10063dcc93add9700fbc4bb535ea1cd9

Contents?: true

Size: 640 Bytes

Versions: 13

Compression:

Stored size: 640 Bytes

Contents

# frozen_string_literal: true

# @param type [String] Classic notification type `error`, `alert` and `info` + custom `success`
# @param data [String, Hash] `String` for backward compatibility,
#   `Hash` for the new functionality `{title: '', body: '', timeout: 5, countdown: false, action: { url: '', method: '', name: ''}}`.
#   The `title` attribute for `Hash` is mandatory.
module Signum
  module NotificationBody
    class Component < ViewComponent::Base
      attr_reader :signal, :data

      def initialize(signal, data)
        @signal = signal
        @data = data.nil? ? {} : data.deep_symbolize_keys
      end
    end
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
signum-0.7.8 app/components/signum/notification_body/component.rb
signum-0.7.4 app/components/signum/notification_body/component.rb
signum-0.7.2 app/components/signum/notification_body/component.rb
signum-0.7.1 app/components/signum/notification_body/component.rb
signum-0.7.0 app/components/signum/notification_body/component.rb
signum-0.6.0 app/components/signum/notification_body/component.rb
signum-0.5.1 app/components/signum/notification_body/component.rb
signum-0.5.0 app/components/signum/notification_body/component.rb
signum-0.4.13 app/components/signum/notification_body/component.rb
signum-0.4.12 app/components/signum/notification_body/component.rb
signum-0.4.11 app/components/signum/notification_body/component.rb
signum-0.4.10 app/components/signum/notification_body/component.rb
signum-0.4.8 app/components/signum/notification_body/component.rb