Sha256: 87e76055894c3f67e944dac5d0375ff861e0663953db5f7a6b12c8c8ec81c378

Contents?: true

Size: 332 Bytes

Versions: 7

Compression:

Stored size: 332 Bytes

Contents

# frozen_string_literal: true

module Macros
  class Contract
    class Prepopulate < Macros::Base
      def initialize(options_key: nil)
        @options_key = options_key
      end

      def call(ctx, **)
        options = ctx[@options_key] || {}
        ctx['contract.default'].prepopulate!(options)
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
ff-tbl-macros-2.0.2 lib/macros/contract/prepopulate.rb
ff-tbl-macros-2.0.1 lib/macros/contract/prepopulate.rb
ff-tbl-macros-2.0.0 lib/macros/contract/prepopulate.rb
ff-tbl-macros-1.0.2 lib/macros/contract/prepopulate.rb
ff-tbl-macros-1.0.1 lib/macros/contract/prepopulate.rb
ff-tbl-macros-1.0.0 lib/macros/contract/prepopulate.rb
ff-tbl-macros-0.1.8 lib/macros/contract/prepopulate.rb