Class: MojComponent::AlertComponent
- Inherits:
-
ApplicationComponent
- Object
- ViewComponent::Base
- ApplicationComponent
- MojComponent::AlertComponent
- Defined in:
- app/components/moj_component/alert_component.rb
Instance Attribute Summary collapse
-
#body ⇒ Object
readonly
Returns the value of attribute body.
-
#dismiss_href ⇒ Object
readonly
Returns the value of attribute dismiss_href.
-
#dismiss_method ⇒ Object
readonly
Returns the value of attribute dismiss_method.
-
#dismiss_text ⇒ Object
readonly
Returns the value of attribute dismiss_text.
-
#heading ⇒ Object
readonly
Returns the value of attribute heading.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Instance Method Summary collapse
-
#initialize(type:, heading:, body:, dismiss_href:, dismiss_text: "Dismiss", dismiss_method: :post) ⇒ AlertComponent
constructor
A new instance of AlertComponent.
Constructor Details
#initialize(type:, heading:, body:, dismiss_href:, dismiss_text: "Dismiss", dismiss_method: :post) ⇒ AlertComponent
Returns a new instance of AlertComponent.
12 13 14 15 16 17 18 19 20 |
# File 'app/components/moj_component/alert_component.rb', line 12 def initialize(type:, heading:, body:, dismiss_href:, dismiss_text: "Dismiss", dismiss_method: :post) @type = check_type(type) @heading = heading @body = body @dismiss_href = dismiss_href @dismiss_text = dismiss_text @dismiss_method = dismiss_method super() end |
Instance Attribute Details
#body ⇒ Object (readonly)
Returns the value of attribute body.
5 6 7 |
# File 'app/components/moj_component/alert_component.rb', line 5 def body @body end |
#dismiss_href ⇒ Object (readonly)
Returns the value of attribute dismiss_href.
5 6 7 |
# File 'app/components/moj_component/alert_component.rb', line 5 def dismiss_href @dismiss_href end |
#dismiss_method ⇒ Object (readonly)
Returns the value of attribute dismiss_method.
5 6 7 |
# File 'app/components/moj_component/alert_component.rb', line 5 def dismiss_method @dismiss_method end |
#dismiss_text ⇒ Object (readonly)
Returns the value of attribute dismiss_text.
5 6 7 |
# File 'app/components/moj_component/alert_component.rb', line 5 def dismiss_text @dismiss_text end |
#heading ⇒ Object (readonly)
Returns the value of attribute heading.
5 6 7 |
# File 'app/components/moj_component/alert_component.rb', line 5 def heading @heading end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
5 6 7 |
# File 'app/components/moj_component/alert_component.rb', line 5 def type @type end |