Class: BadPigeon::HARArchive

Inherits:
Object
  • Object
show all
Defined in:
lib/bad_pigeon/har/har_archive.rb

Overview

Represents a whole request archive bundle loaded from a *.har file.

An archive consists of some number of requests (HARRequest).

Instance Method Summary collapse

Constructor Details

#initialize(data) ⇒ HARArchive

Returns a new instance of HARArchive.



11
12
13
# File 'lib/bad_pigeon/har/har_archive.rb', line 11

def initialize(data)
  @json = JSON.parse(data)
end

Instance Method Details

#inspectObject



19
20
21
# File 'lib/bad_pigeon/har/har_archive.rb', line 19

def inspect
  to_s
end

#requestsObject



15
16
17
# File 'lib/bad_pigeon/har/har_archive.rb', line 15

def requests
  @json['log']['entries'].map { |j| HARRequest.new(j) }
end