lib/tweak_config.rb in tweaks-0.1.0 vs lib/tweak_config.rb in tweaks-0.2.0
- old
+ new
@@ -80,11 +80,10 @@
def copy_item(aHash,aKey)
d = default_values[aKey]
d_class = (d.is_a?(Class) ? d : d.class)
cname = d_class.name.to_sym
case cname
- when :NilClass then ;
when :String then self[aKey] = aHash[aKey].to_s unless aHash[aKey].nil?
when :Float then set_float(aKey,aHash[aKey]);
when :Fixnum then set_int(aKey,aHash[aKey]);
when :TrueClass, :FalseClass then set_boolean(aKey,aHash[aKey]);
when :Symbol then self[aKey] = (aHash[aKey].to_sym rescue nil)
@@ -94,10 +93,10 @@
end
end
def read(aSource,aLimitToDefaults=false)
aSource.each do |k,v|
- copy_item(aSource,k) unless aLimitToDefaults && !default_values.include?[k]
+ copy_item(aSource,k) unless aLimitToDefaults && !default_values.include?(k)
end
self
end
def to_hash