Class: Aikido::Zen::Collector::Events::TrackAttack 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, being_blocked:) ⇒ TrackAttack

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 TrackAttack.



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

def initialize(sink_name, being_blocked:)
  super()
  @sink_name = sink_name
  @being_blocked = being_blocked
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.



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

def self.from_json(data)
  new(
    data[:sink_name],
    being_blocked: data[:being_blocked]
  )
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.



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

def as_json
  super.update({
    sink_name: @sink_name,
    being_blocked: @being_blocked
  })
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.



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

def handle(collector)
  collector.handle_track_attack(@sink_name, being_blocked: @being_blocked)
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.



189
190
191
# File 'lib/aikido/zen/collector/event.rb', line 189

def inspect
  "#<#{self.class.name} #{@sink_name} #{@being_blocked}>"
end