module Interactor::ClearContext::ContextAccessor::ClassMethods

Public Class Methods

require_contexts(*attributes) click to toggle source
# File lib/interactor/clear_context/context_accessor.rb, line 12
def self.require_contexts(*attributes)
  attr_writer attributes
  # define getter
  attributes.each do |attribute|
    define_method attribute do
      instance_variable_get("@#{attribute}") ||= context.send(attribute)
    end
  end
end