Sha256: 20f481d8e3a34ba9c70b79617aecbc0abb5ab744369e0c7de961eef5e047678e

Contents?: true

Size: 570 Bytes

Versions: 1

Compression:

Stored size: 570 Bytes

Contents

module ModelLog
  module Log
    class Content
      include Initializer

      def initialize(resource, action, formatter)
        super(resource, action)
        @formatter = formatter
      end

      def content
        @formatter.new(context).call
      end

      private

      def context
        Context.new(
          current_user: ModelLog.current_user,
          requester: ModelLog.requester,
          action: @action,
          resource: @resource,
          changes: Processor.new(@resource, @action).data
        ).to_struct
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
model_log-2.0.0 lib/model_log/log/content.rb