Class: Aikido::Zen::AttackWave::Request

Inherits:
Object
  • Object
show all
Defined in:
lib/aikido/zen/attack_wave.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(ip_address:, user_agent:, source:) ⇒ Aikido::Zen::AttackWave::Request

Parameters:

  • ip_address (String)
  • user_agent (String)
  • source (String)


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_addressString (readonly)

Returns:

  • (String)


84
85
86
# File 'lib/aikido/zen/attack_wave.rb', line 84

def ip_address
  @ip_address
end

#sourceString (readonly)

Returns:

  • (String)


90
91
92
# File 'lib/aikido/zen/attack_wave.rb', line 90

def source
  @source
end

#user_agentString (readonly)

Returns:

  • (String)


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_jsonObject



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