class Knowledge::Adapters::KeyValue

Description

This adapter takes some vars in a config object and put it in your project's config. The config object should provide a hash with key=value format.

Usage

@example:

# Define your vars with the name of the variable as key and the value as value
my_vars = { application_token: 's3cret', aws_secret: 's3cret' }

# Instanciate the adapter
adapter = Knowledge::Adapters::KeyValue.new(setter: MySetter, variables: my_vars)

# And run it
adapter.run

Attributes

@attr_reader [Class] setter @attr_reader [Hash] variables

Public Instance Methods

run() click to toggle source

Runs the actual adapter.

# File lib/knowledge/adapters/key_value.rb, line 34
def run
  variables.each { |name, value| setter.set(name: name, value: value) }
end