Class: Paltrow::Message
- Inherits:
-
Dry::Struct
- Object
- Dry::Struct
- Paltrow::Message
- Defined in:
- lib/paltrow/message.rb
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.alert(an_alert) ⇒ Object
26 27 28 |
# File 'lib/paltrow/message.rb', line 26 def self.alert an_alert new(text: an_alert, success: false) end |
.notice(a_notice) ⇒ Object
22 23 24 |
# File 'lib/paltrow/message.rb', line 22 def self.notice a_notice new(text: a_notice, success: true) end |
Instance Method Details
#alert ⇒ Object
18 19 20 |
# File 'lib/paltrow/message.rb', line 18 def alert failure? ? text : "" end |
#failure? ⇒ Boolean
10 11 12 |
# File 'lib/paltrow/message.rb', line 10 def failure? !success? end |
#notice ⇒ Object
14 15 16 |
# File 'lib/paltrow/message.rb', line 14 def notice success? ? text : "" end |
#success? ⇒ Boolean
6 7 8 |
# File 'lib/paltrow/message.rb', line 6 def success? success end |