Class: FailFast::ErrorDb
- Inherits:
-
Object
- Object
- FailFast::ErrorDb
- 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
- #append(key, value) ⇒ Object
- #errors_for(key) ⇒ Object
-
#global_data ⇒ Object
:nodoc:.
-
#initialize ⇒ ErrorDb
constructor
A new instance of ErrorDb.
- #keys ⇒ Object
- #messages ⇒ Object
Constructor Details
#initialize ⇒ ErrorDb
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_data ⇒ Object
: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 |
#keys ⇒ Object
15 16 17 |
# File 'lib/fail_fast/support/error_db.rb', line 15 def keys @@hash.keys end |
#messages ⇒ Object
23 24 25 |
# File 'lib/fail_fast/support/error_db.rb', line 23 def @@hash.first[1] end |