lib/checklister/configuration.rb
# Symbolize keys and remove nil or duplicate attributes
# The attributes usually passed to our configuration class by the CLI
# are usually full of duplicates and unconsistant keys, we make sure
# to clean up that input, before doing any configuration work.
#
# @param attributes [Hash] list of key/values
# @return [Hash] a clean list of key/values
#
Symbolize keys and remove nil or duplicate attributes
The attributes usually passed to our configuration class by the CLI
are usually full of duplicates and unconsistant keys, we make sure
to clean up that input, before doing any configuration work.
Symbolize keys and remove nil or duplicate attributes The attributes usually passed to our configuration class by the CLI are usually full of duplicates and unconsistant keys we make sure to clean up that input before doing any configuration work .
def prepare_attributes(attributes)
      symboled_attributes = Checklister::Sanitizer.symbolize attributes
      symboled_attributes.select { |key, _| ATTRIBUTES.include? key }
                         .delete_if { |_, v| v.nil? }
    end
def prepare_attributes ( attributes ) symboled_attributes = Checklister :: Sanitizer . symbolize attributes symboled_attributes . select { | key , _ | ATTRIBUTES . include? key } . delete_if { | _ , v | v . nil? } end
Symbolize keys and remove nil or duplicate attributes
The attributes usually passed to our configuration class by the CLI
are usually full of duplicates and unconsistant keys, we make sure
to clean up that input, before doing any configuration work.
Symbolize keys and remove nil or duplicate attributes The attributes usually passed to our configuration class by the CLI are usually full of duplicates and unconsistant keys we make sure to clean up that input before doing any configuration work .
# Convert string keys to symbols # Clean up user_attributes from unwanted, nil and duplicate options
a clean list of key/values
a clean list of key / values
Hash
attributes
list of key/values
list of key / values