class Macros::Model::Copy

Public Class Methods

new(ctx_key = nil) click to toggle source
# File lib/macros/model/copy.rb, line 6
def initialize(ctx_key = nil)
  @ctx_key = ctx_key
end

Public Instance Methods

call(ctx, **) click to toggle source
# File lib/macros/model/copy.rb, line 10
def call(ctx, **)
  return false unless ctx[@ctx_key]

  ctx[:model] = ctx[@ctx_key]
end