Class: Polytrix::Spy

Inherits:
Object
  • Object
show all
Defined in:
lib/polytrix/spies.rb

Overview

# @abstract

Direct Known Subclasses

Polytrix::Spies::FileSystemSpy

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(app, opts = {}) ⇒ Spy

Returns a new instance of Spy.



6
7
8
9
# File 'lib/polytrix/spies.rb', line 6

def initialize(app, opts = {})
  @app = app
  @opts = opts
end

Class Method Details

.report(type, report_class) ⇒ Object



19
20
21
# File 'lib/polytrix/spies.rb', line 19

def self.report(type, report_class)
  reports[type] = report_class
end

.reportsObject



15
16
17
# File 'lib/polytrix/spies.rb', line 15

def self.reports
  @reports ||= {}
end

Instance Method Details

#call(_challenge) ⇒ Object



11
12
13
# File 'lib/polytrix/spies.rb', line 11

def call(_challenge)
  fail NotImplementedError, 'Subclass must implement #call'
end