Sha256: 38c88fde9c94ad5abb3f14efe4fe391ebff28a657bd0cd57a4ceb394b96f32ea

Contents?: true

Size: 529 Bytes

Versions: 1

Compression:

Stored size: 529 Bytes

Contents

module HAR
  class Page < SchemaType

    attr_reader :entries

    def initialize(input, entries)
      super(input)
      @entries = entries
    end

    # a little sugar
    alias_method :timings, :page_timings

    # Filter entries that *finished* before the specified time
    def entries_before(time)
      raise TypeError, "expected Time" unless time.is_a?(Time)
      entries.select do |entry|
        return false unless entry.time
        entry.started_date_time + entry.time / 1000.0 < time
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
har-0.1.3 lib/har/page.rb