Class: Cease::Examiner

Inherits:
Object
  • Object
show all
Defined in:
lib/cease/examiner.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(source:) ⇒ Examiner

Returns a new instance of Examiner.

Parameters:

  • source (Pathname)


7
8
9
# File 'lib/cease/examiner.rb', line 7

def initialize(source:)
  @source = source
end

Instance Attribute Details

#sourceObject (readonly)

Returns the value of attribute source.



28
29
30
# File 'lib/cease/examiner.rb', line 28

def source
  @source
end

Instance Method Details

#evictionsObject



11
12
13
# File 'lib/cease/examiner.rb', line 11

def evictions
  @evictions ||= Eviction::Context.from_source(source: source)
end

#overdue_evictionsObject



24
25
26
# File 'lib/cease/examiner.rb', line 24

def overdue_evictions
  evictions.select(&:overdue?)
end

#summarizable?Boolean

Returns:

  • (Boolean)


20
21
22
# File 'lib/cease/examiner.rb', line 20

def summarizable?
  overdue_evictions.any?
end

#summarizeObject



15
16
17
18
# File 'lib/cease/examiner.rb', line 15

def summarize
  return unless summarizable?
  Summary.new(examiner: self).summarize
end