Class: Pajamas::BannerComponent
- Defined in:
- app/components/pajamas/banner_component.rb
Constant Summary collapse
- VARIANT_OPTIONS =
[:introduction, :promotion].freeze
Instance Method Summary collapse
-
#initialize(button_text: 'OK', button_link: '#', embedded: false, variant: :promotion, svg_path: nil, banner_options: {}, button_options: {}, close_options: {}) ⇒ BannerComponent
constructor
A new instance of BannerComponent.
Constructor Details
#initialize(button_text: 'OK', button_link: '#', embedded: false, variant: :promotion, svg_path: nil, banner_options: {}, button_options: {}, close_options: {}) ⇒ BannerComponent
Returns a new instance of BannerComponent.
13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
# File 'app/components/pajamas/banner_component.rb', line 13 def initialize( button_text: 'OK', button_link: '#', embedded: false, variant: :promotion, svg_path: nil, banner_options: {}, button_options: {}, close_options: {} ) @button_text = @button_link = @embedded = @variant = filter_attribute(variant.to_sym, VARIANT_OPTIONS, default: :promotion) @svg_path = svg_path.to_s @banner_options = @button_options = @close_options = (options: , css_classes: %w[js-close gl-banner-close]) end |