Class: Gity::Flash

Inherits:
Object
  • Object
show all
Includes:
Singleton, TR::CondUtils
Defined in:
lib/gity/flash.rb

Instance Method Summary collapse

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_msgObject



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

Returns:

  • (Boolean)


29
30
31
# File 'lib/gity/flash.rb', line 29

def has_err_msg?
  not_empty?(error_msg)
end

#has_info_msg?Boolean

Returns:

  • (Boolean)


25
26
27
# File 'lib/gity/flash.rb', line 25

def has_info_msg?
  not_empty?(info_msg)
end

#has_messages?Boolean

Returns:

  • (Boolean)


21
22
23
# File 'lib/gity/flash.rb', line 21

def has_messages?
  not_empty?(info_msg) or not_empty?(error_msg) or not_empty?(warning_msg)
end

#has_warning_msg?Boolean

Returns:

  • (Boolean)


33
34
35
# File 'lib/gity/flash.rb', line 33

def has_warning_msg?
  not_empty?(warning_msg)
end

#info_msgObject



37
38
39
40
41
42
# File 'lib/gity/flash.rb', line 37

def info_msg
  if @_infoMsg.nil?
    @_infoMsg = []
  end
  @_infoMsg
end

#warning_msgObject



51
52
53
54
55
56
# File 'lib/gity/flash.rb', line 51

def warning_msg
  if @_warnMsg.nil?
    @_warnMsg = []
  end
  @_warnMsg
end