Class: Signum::NotificationDrawerItem::Component
- Inherits:
-
ViewComponent::Base
- Object
- ViewComponent::Base
- Signum::NotificationDrawerItem::Component
- Defined in:
- app/components/signum/notification_drawer_item/component.rb
Instance Attribute Summary collapse
-
#data ⇒ Object
readonly
Returns the value of attribute data.
-
#signal ⇒ Object
readonly
Returns the value of attribute signal.
Instance Method Summary collapse
-
#initialize(signal:, data: nil) ⇒ Component
constructor
A new instance of Component.
Constructor Details
#initialize(signal:, data: nil) ⇒ Component
Returns a new instance of Component.
8 9 10 11 12 13 14 |
# File 'app/components/signum/notification_drawer_item/component.rb', line 8 def initialize(signal:, data: nil) @signal = signal @data = data.nil? ? {} : data.deep_symbolize_keys @data[:timeout] ||= 5 @data[:type] ||= :drawer_item end |
Instance Attribute Details
#data ⇒ Object (readonly)
Returns the value of attribute data.
4 5 6 |
# File 'app/components/signum/notification_drawer_item/component.rb', line 4 def data @data end |
#signal ⇒ Object (readonly)
Returns the value of attribute signal.
4 5 6 |
# File 'app/components/signum/notification_drawer_item/component.rb', line 4 def signal @signal end |