Class: Failbot::MemoryBackend

Inherits:
Object
  • Object
show all
Defined in:
lib/failbot/memory_backend.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeMemoryBackend

Returns a new instance of MemoryBackend.



3
4
5
6
# File 'lib/failbot/memory_backend.rb', line 3

def initialize
  @reports = []
  @fail    = false
end

Instance Attribute Details

#reportsObject

Returns the value of attribute reports.



8
9
10
# File 'lib/failbot/memory_backend.rb', line 8

def reports
  @reports
end

Instance Method Details

#fail!Object



10
11
12
# File 'lib/failbot/memory_backend.rb', line 10

def fail!
  @fail = true
end

#pingObject



22
23
24
# File 'lib/failbot/memory_backend.rb', line 22

def ping
  # nop
end

#report(data) ⇒ Object



14
15
16
17
18
19
20
# File 'lib/failbot/memory_backend.rb', line 14

def report(data)
  if @fail
    fail
  end

  @reports << data
end