Class: Gity::Flash
- Inherits:
-
Object
- Object
- Gity::Flash
- Includes:
- Singleton, TR::CondUtils
- Defined in:
- lib/gity/flash.rb
Instance Method Summary collapse
- #add_error(msg) ⇒ Object
- #add_info(msg) ⇒ Object
- #add_warning(msg) ⇒ Object
- #error_msg ⇒ Object
- #has_err_msg? ⇒ Boolean
- #has_info_msg? ⇒ Boolean
- #has_messages? ⇒ Boolean
- #has_warning_msg? ⇒ Boolean
- #info_msg ⇒ Object
- #warning_msg ⇒ Object
Instance Method Details
#add_error(msg) ⇒ Object
13 14 15 |
# File 'lib/gity/flash.rb', line 13 def add_error(msg) error_msg << msg if not_empty?(msg) end |
#add_info(msg) ⇒ Object
9 10 11 |
# File 'lib/gity/flash.rb', line 9 def add_info(msg) info_msg << msg if not_empty?(msg) end |
#add_warning(msg) ⇒ Object
17 18 19 |
# File 'lib/gity/flash.rb', line 17 def add_warning(msg) warning_msg << msg if not_empty?(msg) end |
#error_msg ⇒ Object
44 45 46 47 48 49 |
# File 'lib/gity/flash.rb', line 44 def error_msg if @_errMsg.nil? @_errMsg = [] end @_errMsg end |
#has_err_msg? ⇒ Boolean
29 30 31 |
# File 'lib/gity/flash.rb', line 29 def has_err_msg? not_empty?(error_msg) end |
#has_info_msg? ⇒ Boolean
25 26 27 |
# File 'lib/gity/flash.rb', line 25 def has_info_msg? not_empty?(info_msg) end |
#has_messages? ⇒ Boolean
21 22 23 |
# File 'lib/gity/flash.rb', line 21 def not_empty?(info_msg) or not_empty?(error_msg) or not_empty?(warning_msg) end |
#has_warning_msg? ⇒ Boolean
33 34 35 |
# File 'lib/gity/flash.rb', line 33 def has_warning_msg? not_empty?(warning_msg) end |
#info_msg ⇒ Object
37 38 39 40 41 42 |
# File 'lib/gity/flash.rb', line 37 def info_msg if @_infoMsg.nil? @_infoMsg = [] end @_infoMsg end |
#warning_msg ⇒ Object
51 52 53 54 55 56 |
# File 'lib/gity/flash.rb', line 51 def warning_msg if @_warnMsg.nil? @_warnMsg = [] end @_warnMsg end |