Class: FailFast::ErrorDb

Inherits:
Object
  • Object
show all
Defined in:
lib/fail_fast/support/error_db.rb,
lib/fail_fast/support/z_only_for_tests.rb

Overview

ONLY USED BY TESTS !!

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeErrorDb

Returns a new instance of ErrorDb.



3
4
5
# File 'lib/fail_fast/support/error_db.rb', line 3

def initialize
  @@hash = {}
end

Class Method Details

.key_for(config_file_path, keys_prefix = nil) ⇒ Object



19
20
21
# File 'lib/fail_fast/support/error_db.rb', line 19

def self.key_for(config_file_path, keys_prefix=nil)
  ["<#{config_file_path}>", keys_prefix].compact.join
end

Instance Method Details

#append(key, value) ⇒ Object



11
12
13
# File 'lib/fail_fast/support/error_db.rb', line 11

def append(key, value)
  errors_for(key)  << value
end

#errors_for(key) ⇒ Object



7
8
9
# File 'lib/fail_fast/support/error_db.rb', line 7

def errors_for(key)
  @@hash[key] ||= []
end

#global_dataObject

:nodoc:



3
4
5
# File 'lib/fail_fast/support/z_only_for_tests.rb', line 3

def global_data #:nodoc:
  @@hash.keys.collect {|key|errors_for(key)}.flatten
end

#keysObject



15
16
17
# File 'lib/fail_fast/support/error_db.rb', line 15

def keys
  @@hash.keys
end

#messagesObject



23
24
25
# File 'lib/fail_fast/support/error_db.rb', line 23

def messages
  @@hash.first[1]
end