Module: OnLookerHelper

Defined in:
lib/onlooker.rb

Instance Method Summary collapse

Instance Method Details

#onlooker_format(status, *params) ⇒ Object



35
36
37
38
39
40
41
42
43
44
45
46
# File 'lib/onlooker.rb', line 35

def onlooker_format(status, *params)
  options = params.extract_options!.symbolize_keys
  
  options[:online_img] ||= options.include?(:online_img)
  options[:offline_img] ||= options.include?(:offline_img)
  
  if status == "Online"
    "<img src='#{options[:online_img]}' alt='Online' />"
  else
    "<img src='#{options[:offline_img]}' alt='Offline' />"
  end
end