darthjee/magicka

View on GitHub
lib/magicka/helper/class_methods.rb

Summary

Maintainability
A
0 mins
Test Coverage
A
100%
# frozen_string_literal: true

module Magicka
  module Helper
    # Class methods for {Magicka::Helper}
    module ClassMethods
      # (see Magicka::Helper.with)
      def with(aggregator, type = nil, &block)
        options = AggregatorOptions.new(
          aggregator: aggregator,
          type: type,
          config_block: block
        )

        MethodBuilder.build(self, options) do
          build_aggregator
        end
      end
    end
  end
end