Class: Browser

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

Constant Summary collapse

@@history =
nil

Class Method Summary collapse

Class Method Details

.historyObject



12
13
14
15
16
17
18
19
20
21
22
# File 'lib/red_query/browser.rb', line 12

def self.history
  if @@history.nil?
    if Browser.ie? && Browser.version < 8
      @@history = ::HistoryIE.new
    else
      @@history = ::HistoryNormal.new
    end
  end
  
  @@history
end

.ie?Boolean

Returns:

  • (Boolean)


4
5
6
# File 'lib/red_query/browser.rb', line 4

def self.ie?
  return `jQuery.browser.msie`
end

.versionObject



8
9
10
# File 'lib/red_query/browser.rb', line 8

def self.version
  `parseInt(jQuery.browser.version)`
end