Class: Aikido::Zen::Collector::Events::TrackScan Private

Inherits:
Aikido::Zen::Collector::Event show all
Defined in:
lib/aikido/zen/collector/event.rb

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Instance Attribute Summary

Attributes inherited from Aikido::Zen::Collector::Event

#type

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Aikido::Zen::Collector::Event

register

Constructor Details

#initialize(sink_name, duration, has_errors:) ⇒ TrackScan

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of TrackScan.



165
166
167
168
169
170
# File 'lib/aikido/zen/collector/event.rb', line 165

def initialize(sink_name, duration, has_errors:)
  super()
  @sink_name = sink_name
  @duration = duration
  @has_errors = has_errors
end

Class Method Details

.from_json(data) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



157
158
159
160
161
162
163
# File 'lib/aikido/zen/collector/event.rb', line 157

def self.from_json(data)
  new(
    data[:sink_name],
    data[:duration],
    has_errors: data[:has_errors]
  )
end

Instance Method Details

#as_jsonObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



172
173
174
175
176
177
178
# File 'lib/aikido/zen/collector/event.rb', line 172

def as_json
  super.update({
    sink_name: @sink_name,
    duration: @duration,
    has_errors: @has_errors
  })
end

#handle(collector) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



180
181
182
# File 'lib/aikido/zen/collector/event.rb', line 180

def handle(collector)
  collector.handle_track_scan(@sink_name, @duration, has_errors: @has_errors)
end

#inspectObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



184
185
186
# File 'lib/aikido/zen/collector/event.rb', line 184

def inspect
  "#<#{self.class.name} #{@sink_name} #{format "%0.6f", @duration} #{@has_errors}>"
end