Class: SDM::ReplayChunkEvent

Inherits:
Object
  • Object
show all
Defined in:
lib/models/porcelain.rb

Overview

A ReplayChunkEvent represents a single event within a query replay. The timing information included in each ReplayChunkEvent may be used to replay a session in real time.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(data: nil, duration: nil) ⇒ ReplayChunkEvent

Returns a new instance of ReplayChunkEvent.



8112
8113
8114
8115
8116
8117
8118
# File 'lib/models/porcelain.rb', line 8112

def initialize(
  data: nil,
  duration: nil
)
  @data = data == nil ? "" : data
  @duration = duration == nil ? nil : duration
end

Instance Attribute Details

#dataObject

The raw data of the ReplayChunkEvent.



8108
8109
8110
# File 'lib/models/porcelain.rb', line 8108

def data
  @data
end

#durationObject

The time duration over which the data in this ReplayChunkEvent was transferred.



8110
8111
8112
# File 'lib/models/porcelain.rb', line 8110

def duration
  @duration
end

Instance Method Details

#to_json(options = {}) ⇒ Object



8120
8121
8122
8123
8124
8125
8126
# File 'lib/models/porcelain.rb', line 8120

def to_json(options = {})
  hash = {}
  self.instance_variables.each do |var|
    hash[var.id2name.delete_prefix("@")] = self.instance_variable_get var
  end
  hash.to_json
end