Class: Shoehorn::Components::Alert
- Defined in:
- lib/shoehorn/components/alert.rb
Instance Attribute Summary collapse
-
#message ⇒ Object
readonly
Returns the value of attribute message.
Attributes inherited from Base
Instance Method Summary collapse
-
#initialize(message, options = {}) ⇒ Alert
constructor
A new instance of Alert.
- #to_s ⇒ Object
Constructor Details
#initialize(message, options = {}) ⇒ Alert
Returns a new instance of Alert.
5 6 7 8 |
# File 'lib/shoehorn/components/alert.rb', line 5 def initialize(, = {}) super @message = end |
Instance Attribute Details
#message ⇒ Object (readonly)
Returns the value of attribute message.
3 4 5 |
# File 'lib/shoehorn/components/alert.rb', line 3 def @message end |
Instance Method Details
#to_s ⇒ Object
10 11 12 13 14 15 16 17 18 19 |
# File 'lib/shoehorn/components/alert.rb', line 10 def to_s output_buffer << content_tag(:div, ) do html = "" html << build_close_tag.html_safe if [:close] html << build_heading_tag.html_safe if [:heading] html << html.html_safe end.html_safe super end |