Class: Aikido::Zen::AttackWave::Request
- Inherits:
-
Object
- Object
- Aikido::Zen::AttackWave::Request
- Defined in:
- lib/aikido/zen/attack_wave.rb
Instance Attribute Summary collapse
- #ip_address ⇒ String readonly
- #source ⇒ String readonly
- #user_agent ⇒ String readonly
Instance Method Summary collapse
- #==(other) ⇒ Object (also: #eql?)
- #as_json ⇒ Object
- #initialize(ip_address:, user_agent:, source:) ⇒ Aikido::Zen::AttackWave::Request constructor
Constructor Details
#initialize(ip_address:, user_agent:, source:) ⇒ Aikido::Zen::AttackWave::Request
96 97 98 99 100 |
# File 'lib/aikido/zen/attack_wave.rb', line 96 def initialize(ip_address:, user_agent:, source:) @ip_address = ip_address @user_agent = user_agent @source = source end |
Instance Attribute Details
#ip_address ⇒ String (readonly)
84 85 86 |
# File 'lib/aikido/zen/attack_wave.rb', line 84 def ip_address @ip_address end |
#source ⇒ String (readonly)
90 91 92 |
# File 'lib/aikido/zen/attack_wave.rb', line 90 def source @source end |
#user_agent ⇒ String (readonly)
87 88 89 |
# File 'lib/aikido/zen/attack_wave.rb', line 87 def user_agent @user_agent end |
Instance Method Details
#==(other) ⇒ Object Also known as: eql?
110 111 112 113 114 115 |
# File 'lib/aikido/zen/attack_wave.rb', line 110 def ==(other) other.is_a?(self.class) && other.ip_address == ip_address && other.user_agent == user_agent && other.source == source end |
#as_json ⇒ Object
102 103 104 105 106 107 108 |
# File 'lib/aikido/zen/attack_wave.rb', line 102 def as_json { "ipAddress" => @ip_address, "userAgent" => @user_agent, "source" => @source }.compact end |