class OpenStax::Aws::SecretsSubstitutionsFactory

Attributes

attributes[R]

Public Class Methods

new(context) click to toggle source
# File lib/openstax/aws/secrets_factory.rb, line 115
def initialize(context)
  raise ArgumentError, "context cannot be nil" if context.nil?
  @context = context
  @attributes = {}
end

Public Instance Methods

method_missing(name, *args, &block) click to toggle source
# File lib/openstax/aws/secrets_factory.rb, line 121
def method_missing(name, *args, &block)
  raise "Secrets substitition `#{name}` cannot be called with arguments, only a block" if !args.empty?
  raise "Secrets substitution `#{name}` must be called with a block to set the substitution value" if !block_given?
  attributes[name.to_sym] = @context.instance_eval(&block)
end