Class: SpeedGun::Browser::Navigation

Inherits:
Hash
  • Object
show all
Defined in:
lib/speed_gun/browser/navigation.rb

Constant Summary collapse

[
  'Navigate',
  'Reload',
  'Back/Forward'
]

Instance Method Summary collapse

Constructor Details

#initialize(hash) ⇒ Navigation

Returns a new instance of Navigation.



10
11
12
13
14
# File 'lib/speed_gun/browser/navigation.rb', line 10

def initialize(hash)
  hash.each_pair do |key, val|
    self[key.to_s.to_sym] = val
  end
end

Instance Method Details

#redirect_countObject



20
21
22
# File 'lib/speed_gun/browser/navigation.rb', line 20

def redirect_count
  self[:redirect_count].to_i
end

#typeObject



16
17
18
# File 'lib/speed_gun/browser/navigation.rb', line 16

def type
  NAVIGATION_TYPES[self[:type].to_i] || 'Unknown'
end