Sha256: 1fa75a35e22846a8c5ae5e396484c1742be9e9e272f0297841a3f8b397edd2f1

Contents?: true

Size: 520 Bytes

Versions: 4

Compression:

Stored size: 520 Bytes

Contents

require 'speed_gun'
require 'useragent'

class SpeedGun::Browser
  def initialize(hash)
    @user_agent = UserAgent.parse(hash['user_agent'] || '')
    @navigation = Navigation.new(hash['navigation'] || {})
    @timing = Timing.new(hash['timing'] || {})
  end
  attr_reader :user_agent, :navigation, :timing

  def as_msgpack(*args)
    {
      user_agent: @user_agent.to_s,
      navigation: @navigation,
      timing: @timing,
    }
  end
end

require 'speed_gun/browser/navigation'
require 'speed_gun/browser/timing'

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
speed_gun-0.0.4 lib/speed_gun/browser.rb
speed_gun-0.0.3 lib/speed_gun/browser.rb
speed_gun-0.0.2 lib/speed_gun/browser.rb
speed_gun-0.0.1 lib/speed_gun/browser.rb