Sha256: a3dfc023e7abc1fd57f0c9f96dc95bc21cdeecf59df14203eb85e23eb45f543b

Contents?: true

Size: 418 Bytes

Versions: 2

Compression:

Stored size: 418 Bytes

Contents

# frozen_string_literal: true

module Magicka
  module Helper
    # Builds methods for {Magicka::Helper}
    class MethodBuilder < Sinclair
      # (see Magicka::Helper.with)
      def build_aggregator(aggregator_class, type = aggregator_class.type)
        add_method("magicka_#{type}") do |model, &block|
          block.call(aggregator_class.new(self, model))
        end

        build
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
magicka-1.0.0 lib/magicka/helper/method_builder.rb
magicka-0.6.0 lib/magicka/helper/method_builder.rb