if Rails.env.development? ::ActiveSupport::Notifications.subscribe 'µ-case' do |*args| result = args.extract_options![:result] description = result.use_case.class.name Rack::MiniProfiler.step("µ-case: #{description}") do Rails.logger.warn "µ-case called: #{description}" end end module Micro class Case class Result class Transitions MapEverything = ->(result, use_case_attributes) do ::ActiveSupport::Notifications.instrument 'µ-case', result: result do { use_case: { class: result.use_case.class, attributes: use_case_attributes }, result.to_sym => { type: result.type, result: result.data }, accessible_attributes: result.accessible_attributes } end end end end end end end