Sha256: ec8b510da206ec5506c4e5deb30016a37040a8fb72c277d4fc854775e9aeb10f
Contents?: true
Size: 689 Bytes
Versions: 31
Compression:
Stored size: 689 Bytes
Contents
module ASIR IDENTITY_PROC = lambda { | x | x } module Configuration def self.included target super target.extend ClassMethods end # Global default config_proc def self.config_proc_hash @@config_proc_hash ||= { } end module ClassMethods def config_proc ASIR::Configuration.config_proc_hash[self] end def config_proc= x ASIR::Configuration.config_proc_hash[self] = x end end def initialize *args super ch = ASIR::Configuration.config_proc_hash (self.class.ancestors.map{|m| ch[m]}.compact.first || ch[nil] || IDENTITY_PROC ).call(self) end end end
Version data entries
31 entries across 31 versions & 1 rubygems