Class: TTK::Testers::Tester::Config
- Includes:
- DRb::DRbUndumped
- Defined in:
- lib/ttk/testers/tester/config.rb
Instance Method Summary collapse
- #[](key) ⇒ Object
- #clone ⇒ Object
- #dup ⇒ Object
- #has_key?(key) ⇒ Boolean
-
#initialize(extra_config) ⇒ Config
constructor
A new instance of Config.
- #keys ⇒ Object
- #values ⇒ Object
Constructor Details
#initialize(extra_config) ⇒ Config
Returns a new instance of Config.
19 20 21 22 23 24 25 26 27 28 |
# File 'lib/ttk/testers/tester/config.rb', line 19 def initialize(extra_config) @config = {} extra_config.each do |k, v| unless ::Config::CONFIG.has_key?(k) @config[k] = v.dup.freeze else @config[k] = ::Config::CONFIG[key.to_s].dup.freeze end end end |
Instance Method Details
#[](key) ⇒ Object
30 31 32 33 34 35 36 |
# File 'lib/ttk/testers/tester/config.rb', line 30 def [](key) if ::Config::CONFIG.has_key?(key.to_s) @config[key] = ::Config::CONFIG[key.to_s].dup.freeze else @config[key] end end |
#clone ⇒ Object
54 55 56 |
# File 'lib/ttk/testers/tester/config.rb', line 54 def clone @config.clone end |
#dup ⇒ Object
50 51 52 |
# File 'lib/ttk/testers/tester/config.rb', line 50 def dup @config.dup end |
#has_key?(key) ⇒ Boolean
38 39 40 |
# File 'lib/ttk/testers/tester/config.rb', line 38 def has_key?(key) (@config.has_key?(key) or ::Config::CONFIG.has_key?(key.to_s)) end |
#keys ⇒ Object
42 43 44 |
# File 'lib/ttk/testers/tester/config.rb', line 42 def keys @config.keys end |
#values ⇒ Object
46 47 48 |
# File 'lib/ttk/testers/tester/config.rb', line 46 def values @config.values end |