Class: GraphAttack::Configuration

Inherits:
Object
  • Object
show all
Defined in:
lib/graph_attack/configuration.rb

Overview

Store the config

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfiguration

Returns a new instance of Configuration.



18
19
20
21
22
23
# File 'lib/graph_attack/configuration.rb', line 18

def initialize
  @threshold = nil
  @interval = nil
  @on = :ip
  @redis_client = Redis.new
end

Instance Attribute Details

#intervalObject

Time interval in seconds.



10
11
12
# File 'lib/graph_attack/configuration.rb', line 10

def interval
  @interval
end

#onObject

Key on the context on which to differentiate users.



13
14
15
# File 'lib/graph_attack/configuration.rb', line 13

def on
  @on
end

#redis_clientObject

Use a custom Redis client.



16
17
18
# File 'lib/graph_attack/configuration.rb', line 16

def redis_client
  @redis_client
end

#thresholdObject

Number of calls allowed.



7
8
9
# File 'lib/graph_attack/configuration.rb', line 7

def threshold
  @threshold
end