Class: Bulma::NotificationComponent

Inherits:
Component
  • Object
show all
Defined in:
app/components/bulma/notification_component.rb

Instance Method Summary collapse

Constructor Details

#initialize(color: nil, light: false) ⇒ NotificationComponent

Returns a new instance of NotificationComponent.



7
8
9
10
# File 'app/components/bulma/notification_component.rb', line 7

def initialize(color: nil, light: false)
  @color = color
  @light = light
end

Instance Method Details

#classesObject



12
13
14
15
16
17
18
# File 'app/components/bulma/notification_component.rb', line 12

def classes
  class_names(
    "notification",
    "is-#{@color}" => @color.present?,
    "is-light" => @light
  )
end