Class: Browserinfo::GetInfo

Inherits:
Object
  • Object
show all
Defined in:
lib/browserinfo.rb

Overview

Your code goes here…

Class Method Summary collapse

Class Method Details

.process(info) ⇒ Object



7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# File 'lib/browserinfo.rb', line 7

def self.process(info)
  
  content = Hash.new
  if info.include?("Chrome")
    content[:browser] = 'Chrome'
  elsif info.include?("Firefox")
    content[:browser] = 'Firefox'
  elsif info.include?("Safari")
    content[:browser] = 'Safari'
  elsif info.include?("Explorer")
    content[:browser] = 'Internet Explorer'
  else
    content[:browser] = 'Not recognized'
  end

end