Sha256: eeece34f82ba8df5c5cc5b9e1eb6f2daf35c5dd36f1aa6f24819faf88e9a4350

Contents?: true

Size: 655 Bytes

Versions: 11

Compression:

Stored size: 655 Bytes

Contents

module WaterDrop
  module Aspects
    # Class used to format message that will be send from an aspect
    class Formatter
      # @param [Hash] options from an aspect
      # @param [Array] args original method arguments
      # @param result of execution of the method
      def initialize(options, args, result)
        @options = options
        @args = args
        @result = result
      end

      # @return [Hash] hash with formatted message that can be send
      def message
        {
          topic:  @options[:topic],
          method: @options[:method],
          message: @result,
          args: @args
        }
      end
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
waterdrop-0.1.12 lib/water_drop/aspects/formatter.rb
waterdrop-0.1.11 lib/water_drop/aspects/formatter.rb
waterdrop-0.1.10 lib/water_drop/aspects/formatter.rb
waterdrop-0.1.9 lib/water_drop/aspects/formatter.rb
waterdrop-0.1.8 lib/water_drop/aspects/formatter.rb
waterdrop-0.1.7 lib/water_drop/aspects/formatter.rb
waterdrop-0.1.6 lib/water_drop/aspects/formatter.rb
waterdrop-0.1.5 lib/water_drop/aspects/formatter.rb
waterdrop-0.1.3 lib/water_drop/aspects/formatter.rb
waterdrop-0.1.1 lib/water_drop/aspects/formatter.rb
waterdrop-0.1.0 lib/water_drop/aspects/formatter.rb