Class: Aikido::Zen::Events::Attack
- Inherits:
-
Aikido::Zen::Event
- Object
- Aikido::Zen::Event
- Aikido::Zen::Events::Attack
- Defined in:
- lib/aikido/zen/event.rb
Instance Attribute Summary collapse
-
#attack ⇒ Object
readonly
Returns the value of attribute attack.
Attributes inherited from Aikido::Zen::Event
Instance Method Summary collapse
- #as_json ⇒ Object
-
#initialize(attack:, **opts) ⇒ Attack
constructor
A new instance of Attack.
Constructor Details
#initialize(attack:, **opts) ⇒ Attack
Returns a new instance of Attack.
37 38 39 40 |
# File 'lib/aikido/zen/event.rb', line 37 def initialize(attack:, **opts) @attack = attack super(type: "detected_attack", **opts) end |
Instance Attribute Details
#attack ⇒ Object (readonly)
Returns the value of attribute attack.
35 36 37 |
# File 'lib/aikido/zen/event.rb', line 35 def attack @attack end |
Instance Method Details
#as_json ⇒ Object
42 43 44 45 46 47 |
# File 'lib/aikido/zen/event.rb', line 42 def as_json super.update( attack: @attack.as_json, request: @attack.context.request.as_json ) end |