Sha256: 9ffb5210f0f0b2c7a8777e650c79c61cab8b5f0c21cd61f8841e6c0b259cc663
Contents?: true
Size: 748 Bytes
Versions: 8
Compression:
Stored size: 748 Bytes
Contents
module Encryption module Configuration class Base def initialize @config = { } end def config yield self end def method_missing(name, *args) return @config[name.to_sym] if is_valid_getter(name) return @config[name[0..-2].to_sym] = args[0] if is_valid_setter(name) super end def respond_to?(name) return true if is_valid_getter(name) or is_valid_setter(name) super end private def is_valid_getter(name) @config.has_key? name.to_sym end def is_valid_setter(name) name = name.to_s name[-1, 1] == '=' and @config.has_key? name[0..-2].to_sym end end end end
Version data entries
8 entries across 8 versions & 1 rubygems