Class: TTK::Testers::Tester::Config

Inherits:
Object
  • Object
show all
Includes:
DRb::DRbUndumped
Defined in:
lib/ttk/testers/tester/config.rb

Instance Method Summary collapse

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

#cloneObject



54
55
56
# File 'lib/ttk/testers/tester/config.rb', line 54

def clone
  @config.clone
end

#dupObject



50
51
52
# File 'lib/ttk/testers/tester/config.rb', line 50

def dup
  @config.dup
end

#has_key?(key) ⇒ Boolean

Returns:

  • (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

#keysObject



42
43
44
# File 'lib/ttk/testers/tester/config.rb', line 42

def keys
  @config.keys
end

#valuesObject



46
47
48
# File 'lib/ttk/testers/tester/config.rb', line 46

def values
  @config.values
end