class BiolaLogs::Generators::Params
Constants
- NON_QUERY_STRING_PARAMS
- SUPPORTED_HTTP_METHODS
We don’t need form POST data in the logs since it can be very verbose.
Public Instance Methods
to_hash()
click to toggle source
# File lib/biola_logs/generators/params.rb, line 8 def to_hash if method_supported? && clean_params.any? {params: clean_params.to_json} else {} end end
Private Instance Methods
clean_params()
click to toggle source
# File lib/biola_logs/generators/params.rb, line 18 def clean_params @clean_params ||= event.payload[:params].except(*NON_QUERY_STRING_PARAMS) end
method_supported?()
click to toggle source
# File lib/biola_logs/generators/params.rb, line 22 def method_supported? SUPPORTED_HTTP_METHODS.include?(event.payload[:method]) end