Sha256: e791c9309e08d765626429384b611f3dc2be7913f1fe14079f7415434d3520b4
Contents?: true
Size: 548 Bytes
Versions: 10
Compression:
Stored size: 548 Bytes
Contents
# frozen_string_literal: true module ChartMogul module ConfigAttributes def config_accessor(attribute, default_value = nil) define_method(attribute) do attr = config.send(attribute) || default_value if attr.nil? raise ConfigurationError, "Configuration for #{attribute} not set" end attr end define_method("#{attribute}=") do |val| config.send("#{attribute}=", val) Thread.current[ChartMogul::APIResource::THREAD_CONNECTION_KEY] = nil end end end end
Version data entries
10 entries across 10 versions & 1 rubygems