lib/checklister/configuration.rb
def apply(attributes = {})
      prepared_attributes = prepare_attributes attributes
      prepared_attributes.each_pair do |attribute, value|
        send("#{attribute}=", value)
      end
      self
    end
# Apply a configuration hash to a configuration instance
#
# @example Override one of the configuration attributes
#   config = Checklister::Configuration.new
#   config.apply(private_token: 'supersecret')
#   config.private_token #=> "supersecret"
#
# @param attributes [Hash] list of key/values to apply to the configuration
# @return [Object] the configuration object
#
Apply a configuration hash to a configuration instance
Apply a configuration hash to a configuration instance
def apply(attributes = {})
      prepared_attributes = prepare_attributes attributes
      prepared_attributes.each_pair do |attribute, value|
        send("#{attribute}=", value)
      end
      self
    end
def apply ( attributes = { } ) prepared_attributes = prepare_attributes attributes prepared_attributes . each_pair do | attribute , value | send ( "#{attribute}=" , value ) end self end
Apply a configuration hash to a configuration instance
Apply a configuration hash to a configuration instance
the configuration object
the configuration object
Object
attributes
list of key/values to apply to the configuration
list of key / values to apply to the configuration
example
Override one of the configuration attributes config = Checklister::Configuration.new config.apply(private_token: 'supersecret') config.private_token #=> "supersecret"
Override one of the configuration attributes config = Checklister :: Configuration . new config . apply ( private_token : ' supersecret ' ) config . private_token # = > " supersecret "