Sha256: ba45c67585cb52690f2b3d0fd9484f8aed943151a20d86453c6468328e36621b

Contents?: true

Size: 371 Bytes

Versions: 7

Compression:

Stored size: 371 Bytes

Contents

# frozen_string_literal: true

module Macros
  class Ctx
    class Copy < Macros::Base
      def initialize(origin_key, destination_key)
        @origin_key = origin_key
        @destination_key = destination_key
      end

      def call(ctx, **)
        return false unless ctx[@origin_key]

        ctx[@destination_key] = ctx[@origin_key]
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

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