Sha256: e3978f42d6dc129595d9683e5829bac305474d4a561d7791031ef0409fc46bbb
Contents?: true
Size: 546 Bytes
Versions: 14
Compression:
Stored size: 546 Bytes
Contents
require "chanko/unit/extender/active_record_class_methods" require "chanko/unit/extender/extension" module Chanko module Unit class Extender def initialize(prefix = nil) @prefix = prefix end def expand(mod, &block) mod = mod.to_s.camelize.constantize unless mod.is_a?(Module) extension = Extension.new(mod, @prefix, &block) mod.class_eval do include extension.instance_methods_module extend extension.class_methods_module end end end end end
Version data entries
14 entries across 14 versions & 1 rubygems