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-0.9.70 lib/active_rest_client/recording.rb
active_rest_client-0.9.69 lib/active_rest_client/recording.rb
active_rest_client-0.9.68 lib/active_rest_client/recording.rb
active_rest_client-0.9.67 lib/active_rest_client/recording.rb
active_rest_client-0.9.66 lib/active_rest_client/recording.rb
active_rest_client-0.9.65 lib/active_rest_client/recording.rb
active_rest_client-0.9.60 lib/active_rest_client/recording.rb
active_rest_client-0.9.59 lib/active_rest_client/recording.rb
active_rest_client-0.9.58 lib/active_rest_client/recording.rb