Sha256: 6980f374d62647ea6d010e551302577708bd078ec7a0b695660e0df972ee5868

Contents?: true

Size: 482 Bytes

Versions: 29

Compression:

Stored size: 482 Bytes

Contents

module ActiveRestClient
  module Recording
    module ClassMethods
      @record_response = nil

      def record_response(url = nil, response = nil, &block)
        if url && response && @record_response
          @record_response.call(url, response)
        elsif block
          @record_response = block
        end
      end

      def record_response?
        !!@record_response
      end
    end

    def self.included(base)
      base.extend(ClassMethods)
    end

  end
end

Version data entries

29 entries across 29 versions & 1 rubygems

Version Path
active_rest_client-1.2.0 lib/active_rest_client/recording.rb
active_rest_client-1.1.12 lib/active_rest_client/recording.rb
active_rest_client-1.1.11 lib/active_rest_client/recording.rb
active_rest_client-1.1.10 lib/active_rest_client/recording.rb
active_rest_client-1.1.9 lib/active_rest_client/recording.rb
active_rest_client-1.1.0 lib/active_rest_client/recording.rb
active_rest_client-1.0.9 lib/active_rest_client/recording.rb
active_rest_client-1.0.8 lib/active_rest_client/recording.rb
active_rest_client-1.0.7 lib/active_rest_client/recording.rb
active_rest_client-1.0.6 lib/active_rest_client/recording.rb
active_rest_client-1.0.5 lib/active_rest_client/recording.rb
active_rest_client-1.0.4 lib/active_rest_client/recording.rb
active_rest_client-1.0.3 lib/active_rest_client/recording.rb
active_rest_client-1.0.2 lib/active_rest_client/recording.rb
active_rest_client-1.0.1 lib/active_rest_client/recording.rb
active_rest_client-1.0.0 lib/active_rest_client/recording.rb
active_rest_client-0.9.75 lib/active_rest_client/recording.rb
active_rest_client-0.9.73 lib/active_rest_client/recording.rb
active_rest_client-0.9.72 lib/active_rest_client/recording.rb
active_rest_client-0.9.71 lib/active_rest_client/recording.rb