Class: Contrast::Agent::Reporting::Settings::BotBlocker

Inherits:
Object
  • Object
show all
Defined in:
lib/contrast/agent/reporting/settings/bot_blocker.rb

Overview

Indicate if the bot protection feature set is enabled for this server or not.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeBotBlocker

Returns a new instance of BotBlocker.



15
16
17
# File 'lib/contrast/agent/reporting/settings/bot_blocker.rb', line 15

def initialize
  @enable = true
end

Instance Attribute Details

#enableBoolean

Returns:

  • (Boolean)


13
14
15
# File 'lib/contrast/agent/reporting/settings/bot_blocker.rb', line 13

def enable
  @enable
end

Instance Method Details

#botsObject



20
21
22
# File 'lib/contrast/agent/reporting/settings/bot_blocker.rb', line 20

def bots
  @_bots ||= []
end

#bots=(bots_array) ⇒ Object



24
25
26
27
28
# File 'lib/contrast/agent/reporting/settings/bot_blocker.rb', line 24

def bots= bots_array
  Contrast::Agent::Reporting::Settings::Helpers.array_to_iv(Contrast::Agent::Reporting::Settings::Bot,
                                                            bots,
                                                            bots_array)
end

#to_controlled_hashObject

We should be receiving: bot_blockers { enable, bots[case_sensitive, start_anchor]} Instead in the response there is bot_blockers[], and the enable which can be retrieved from bot-blocker.



34
35
36
# File 'lib/contrast/agent/reporting/settings/bot_blocker.rb', line 34

def to_controlled_hash
  @enable
end