Sha256: 8d3137544568a2828366cd50dc6d3c97f5726514e84d4a3f725e7e9b2e1cbfd2
Contents?: true
Size: 725 Bytes
Versions: 13
Compression:
Stored size: 725 Bytes
Contents
module ConfigHelper extend ActiveSupport::Concern def with_config(preference_name, temporary_value) original_config_value = ActiveEnum.config.send(preference_name) ActiveEnum.config.send(:"#{preference_name}=", temporary_value) yield ensure ActiveEnum.config.send(:"#{preference_name}=", original_config_value) end module ClassMethods def with_config(preference_name, temporary_value) original_config_value = ActiveEnum.config.send(preference_name) before(:all) do ActiveEnum.config.send(:"#{preference_name}=", temporary_value) end after(:all) do ActiveEnum.config.send(:"#{preference_name}=", original_config_value) end end end end
Version data entries
13 entries across 13 versions & 1 rubygems