Sha256: c9efebee55963687f6bc68beef4f1013387e9aa076c65d0c4a50cc6dc138586e

Contents?: true

Size: 542 Bytes

Versions: 1

Compression:

Stored size: 542 Bytes

Contents

# frozen_string_literal: true

module Pragma
  module Operation
    # Finds the requested record, authorizes it and decorates it.
    #
    # @author Alessandro Desantis
    class Show < Pragma::Operation::Base
      step Macro::Classes()
      step Macro::Model(:find_by), fail_fast: true
      step Macro::Policy(), fail_fast: true
      step Macro::Decorator()
      step :respond!

      def respond!(options)
        options['result.response'] = Response::Ok.new(entity: options['result.decorator.instance'])
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
pragma-2.0.0 lib/pragma/operation/show.rb