Sha256: 9569b0db17cd9a1a093f9ecec575f04fabd87f7f09436466cb81f650c96eaf3f

Contents?: true

Size: 978 Bytes

Versions: 5

Compression:

Stored size: 978 Bytes

Contents

module RestClient
  module Jogger
    class Configuration
      include ActiveModel::Model

      REQUIRED_ATTRIBUTES = %i().freeze
      OPTIONAL_ATTRIBUTES = %i(
        request_pattern
        response_pattern
        default_content_type
        default_filter_replacement
        log_output
        filter_parameters
      ).freeze
      ATTRIBUTES = (REQUIRED_ATTRIBUTES | OPTIONAL_ATTRIBUTES).freeze

      attr_accessor *ATTRIBUTES

      def request_pattern
        @request_pattern || 'rest_client.request'
      end

      def response_pattern
        @response_pattern || 'rest_client.response'
      end

      def default_content_type
        @default_content_type || 'application/json'
      end

      def default_filter_replacement
        @default_filter_replacement || '[FILTERED]'
      end

      def log_output
        @log_output || 'log/rest_client.log'
      end

      def filter_parameters
        @filter_parameters || []
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
rest-client-jogger-1.3.0 lib/rest_client/jogger/configuration.rb
rest-client-jogger-1.2.2 lib/rest_client/jogger/configuration.rb
rest-client-jogger-1.2.1 lib/rest_client/jogger/configuration.rb
rest-client-jogger-1.2.0 lib/rest_client/jogger/configuration.rb
rest-client-jogger-1.1.0 lib/rest_client/jogger/configuration.rb