Class: Signum::Notification::Component

Inherits:
ViewComponent::Base
  • Object
show all
Defined in:
app/components/signum/notification/component.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(signal, data: nil) ⇒ Component

Returns a new instance of Component.



12
13
14
15
16
17
18
# File 'app/components/signum/notification/component.rb', line 12

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

  @data[:timeout] ||= 5
  @data[:type] ||= :balloon
end

Instance Attribute Details

#dataObject (readonly)

Returns the value of attribute data.



10
11
12
# File 'app/components/signum/notification/component.rb', line 10

def data
  @data
end

#signalObject (readonly)

Returns the value of attribute signal.



10
11
12
# File 'app/components/signum/notification/component.rb', line 10

def signal
  @signal
end