Class: AiRootShield::Enterprise::RealTimeDetectionEngine

Inherits:
Object
  • Object
show all
Defined in:
lib/ai_root_shield/enterprise/hybrid_detection_engine.rb

Overview

Real-time detection engine for immediate threat response

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(config) ⇒ RealTimeDetectionEngine

Returns a new instance of RealTimeDetectionEngine.



429
430
431
432
# File 'lib/ai_root_shield/enterprise/hybrid_detection_engine.rb', line 429

def initialize(config)
  @config = config
  @status = { active: false, threats_blocked: 0 }
end

Instance Attribute Details

#status ⇒ Object (readonly)

Returns the value of attribute status.



427
428
429
# File 'lib/ai_root_shield/enterprise/hybrid_detection_engine.rb', line 427

def status
  @status
end

Instance Method Details

#analyze(data, options = {}) ⇒ Object



444
445
446
447
448
449
450
451
452
453
454
455
456
457
# File 'lib/ai_root_shield/enterprise/hybrid_detection_engine.rb', line 444

def analyze(data, options = {})
  return {} unless @status[:active]
  
  risk_score = calculate_immediate_risk(data)
  factors = detect_immediate_threats(data)
  
  {
    risk_score: risk_score,
    factors: factors,
    confidence: 0.85,
    response_time_ms: 50,
    analysis_type: :real_time
  }
end

#start ⇒ Object



434
435
436
437
# File 'lib/ai_root_shield/enterprise/hybrid_detection_engine.rb', line 434

def start
  @status[:active] = true
  @status[:started_at] = Time.now.utc.iso8601
end

#stop ⇒ Object



439
440
441
442
# File 'lib/ai_root_shield/enterprise/hybrid_detection_engine.rb', line 439

def stop
  @status[:active] = false
  @status[:stopped_at] = Time.now.utc.iso8601
end