Sha256: f12c6eccc0cc2f968811d95efbb1abb39d0d490a5baee14191942c2c5c10a5fb
Contents?: true
Size: 869 Bytes
Versions: 19
Compression:
Stored size: 869 Bytes
Contents
# frozen_string_literal: true require_relative "base" module Neetob class CLI module Cloudflare class BotFightMode < Base attr_accessor :domain def initialize(domain) super() @domain = domain end def run zone_id = ZONE_IDS[domain.to_sym] unless Thread.current[:audit_mode] raise(StandardError, "Domain '#{domain}' not found.") if zone_id.nil? end url = create_url(zone_id, "bot_management") response = get(url) ui.info( "Bot fight mode is turned #{response[:result][:fight_mode] ? print_success("on") : print_failure("off")}", print_to_audit_log: false) if Thread.current[:audit_mode] response[:result][:fight_mode] end end end end end end
Version data entries
19 entries across 19 versions & 1 rubygems