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

Version Path
chanko-2.3.0 lib/chanko/unit/extender.rb
chanko-2.2.1 lib/chanko/unit/extender.rb
chanko-2.2.0 lib/chanko/unit/extender.rb
chanko-2.1.1 lib/chanko/unit/extender.rb
chanko-2.1.0 lib/chanko/unit/extender.rb
chanko-2.0.8 lib/chanko/unit/extender.rb
chanko-2.0.7 lib/chanko/unit/extender.rb
chanko-2.0.6 lib/chanko/unit/extender.rb
chanko-2.0.5 lib/chanko/unit/extender.rb
chanko-2.0.4 lib/chanko/unit/extender.rb
chanko-2.0.3 lib/chanko/unit/extender.rb
chanko-2.0.2 lib/chanko/unit/extender.rb
chanko-2.0.1 lib/chanko/unit/extender.rb
chanko-2.0.0 lib/chanko/unit/extender.rb