Class: Spark::Banner
Constant Summary
collapse
- THEME =
%i[message alert warning admin].freeze
Instance Method Summary
collapse
#selector, #to_s, #unique_id
Constructor Details
#initialize ⇒ Banner
Returns a new instance of Banner.
10
11
12
13
14
15
|
# File 'app/components/spark/banner.rb', line 10
def initialize(*)
super
tag_attrs.add(role: "banner")
classname.add("app-banner", "theme-#{@theme}")
end
|
Instance Method Details
#theme_icon ⇒ Object
20
21
22
23
24
25
26
27
|
# File 'app/components/spark/banner.rb', line 20
def theme_icon
case @theme.to_sym
when :message then "message-text"
when :alert then "message-alert"
when :warning then "message-alert"
when :admin then "admin-user"
end
end
|
#to_partial_path ⇒ Object
17
18
|
# File 'app/components/spark/banner.rb', line 17
def to_partial_path
end
|