Class: ConservationGuardian::Detector

Inherits:
Object
  • Object
show all
Defined in:
lib/conservation_guardian/detector.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(budget, profiler) ⇒ Detector

Returns a new instance of Detector.



7
8
9
10
# File 'lib/conservation_guardian/detector.rb', line 7

def initialize(budget, profiler)
  @budget   = budget
  @profiler = profiler
end

Instance Attribute Details

#budgetObject (readonly)

Returns the value of attribute budget.



5
6
7
# File 'lib/conservation_guardian/detector.rb', line 5

def budget
  @budget
end

#profilerObject (readonly)

Returns the value of attribute profiler.



5
6
7
# File 'lib/conservation_guardian/detector.rb', line 5

def profiler
  @profiler
end

Instance Method Details

#detectObject



12
13
14
15
16
17
# File 'lib/conservation_guardian/detector.rb', line 12

def detect
  findings = []
  findings.concat(detect_over_budget)
  findings.concat(detect_anomalies)
  findings
end