lib/bindata/sanitize.rb in bindata-2.4.1 vs lib/bindata/sanitize.rb in bindata-2.4.2
- old
+ new
@@ -304,13 +304,11 @@
ensure_mandatory_parameters_exist
ensure_mutual_exclusion_of_parameters
end
def needs_sanitizing?(key)
- parameter = self[key]
-
- parameter && !parameter.is_a?(SanitizedParameter)
+ has_key?(key) && ! self[key].is_a?(SanitizedParameter)
end
def ensure_no_nil_values
each do |key, value|
if value.nil?
@@ -320,10 +318,10 @@
end
end
def merge_default_parameters!
@the_class.default_parameters.each do |key, value|
- self[key] ||= value
+ self[key] = value unless has_key?(key)
end
end
def ensure_mandatory_parameters_exist
@the_class.mandatory_parameters.each do |key|