korben 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/korben/kc_config.rb +3 -6
- data/lib/korben/version.rb +1 -1
- metadata +1 -1
data/lib/korben/kc_config.rb
CHANGED
@@ -30,18 +30,15 @@ class KcWrapper
|
|
30
30
|
end
|
31
31
|
|
32
32
|
def load!(settings = {})
|
33
|
-
settings.each
|
34
|
-
set(key, value)
|
35
|
-
end
|
33
|
+
settings.each { |key, value| set(key, value) }
|
36
34
|
end
|
37
35
|
|
38
36
|
def set(key, value)
|
39
|
-
unset(key) if set?(key)
|
40
37
|
define_accessor(key) { value }
|
41
38
|
@settings[key] = value
|
42
39
|
end
|
43
40
|
|
44
|
-
def
|
41
|
+
def exist?(key)
|
45
42
|
@settings.key?(key)
|
46
43
|
end
|
47
44
|
|
@@ -52,7 +49,7 @@ class KcWrapper
|
|
52
49
|
private
|
53
50
|
|
54
51
|
def define_accessor(name, &block)
|
55
|
-
singleton_class.class_eval { define_method(name, &block) } if !respond_to?(name) ||
|
52
|
+
singleton_class.class_eval { define_method(name, &block) } if !respond_to?(name) || exist?(name)
|
56
53
|
end
|
57
54
|
|
58
55
|
def singleton_class
|
data/lib/korben/version.rb
CHANGED