Sha256: ef3ddef1513729b56d778918ae1999638a078e3a4b34947055a5c40529a76e78
Contents?: true
Size: 1.02 KB
Versions: 18
Compression:
Stored size: 1.02 KB
Contents
require "logtail/util" require "logtail/event" module Logtail module Events # @private class ControllerCall < Logtail::Event attr_reader :controller, :action, :params, :params_json, :format def initialize(attributes) @controller = attributes[:controller] @action = attributes[:action] @params = attributes[:params] if @params @params_json = @params.to_json end @format = attributes[:format] end def message message = "Processing by #{controller}##{action}" if !message.nil? message << " as #{format}" end if !params.nil? && params.length > 0 message << "\n Parameters: #{params.inspect}" end message end def to_hash { controller_called: Util::NonNilHashBuilder.build do |h| h.add(:controller, controller) h.add(:action, action) h.add(:params_json, params_json) end } end end end end
Version data entries
18 entries across 18 versions & 2 rubygems